﻿import clr
import sys
import re
import threading
import os
import os.path
clr.AddReference("System.Windows.Forms")
clr.AddReference("System.Drawing")
clr.AddReference("Ans.UI")
clr.AddReference("Ans.Core")
clr.AddReference("System.Data")
clr.AddReference("System")
clr.AddReference("Ans.Utilities")
clr.AddReference("Ans.UI.Toolkit")
clr.AddReference("Ans.UI.Toolkit.Base")
clr.AddReference("Ansys.AAP.PublicAPIs")

import System
import System.IO
import System.Drawing
import System.Windows.Forms
import System.Collections
import Ansys.Core
import System.Data
import System.Text
import Ansys.Utilities
import Ansys


from Ansys.AAP.PublicAPIs import *
from Ansys.AAP.PublicAPIs.Geometry import *
from Ansys.AAP.PublicAPIs.Mesh import *
from Ansys.AAP.PublicAPIs.Analysis import *

from Ansys.UI.Toolkit import *
from Ansys.Utilities import ApplicationConfiguration
from System.Drawing import *
from System.Windows.Forms import *
from System.Collections import *
from System.Windows.Forms import (MessageBox, MessageBoxButtons, MessageBoxIcon)
from Ansys.Core import(DataModel)
from System.Text import(RegularExpressions)
from System.Data import *
from System.Text import *

class MainForm(Form):
	listEngineerData =  Hashtable()
	typeEngineerData =  Hashtable()
	hsMaSatBeTong = Hashtable()
	tySoCan = Hashtable()
	statusActionForEngineerData = ""
	VL_Lop_1 = ""
	VL_Lop_2 = ""
	VL_Lop_3 = ""
	VL_Congtrinh = ""
	VL_KhoiNo = ""
	ListInitVLCT = ["Titanium Alloy","Structural Steel","Stainless Steel","Polyethylene","Magnesium Alloy","Gray Cast Iron","Copper Alloy","Concrete","Aluminum Alloy"]
	def __init__(self):
		self.InitializeComponent()
		self.Init_EngineerData()
		self.LoadInitElements()
	def LoadInitElements(self):
		directoryName = r"C:\Program Files\ANSYS Inc\v145\Addins\ExternalConnection\Customization\Scripts\Image_MHHH.png"
		self._pic_MHHH.BackgroundImage = System.Drawing.Bitmap(directoryName)
	def InitializeComponent(self):
		self._tabControl1 = System.Windows.Forms.TabControl()
		self._tabPage1 = System.Windows.Forms.TabPage()
		self._tabPage2 = System.Windows.Forms.TabPage()
		self._tabPage3 = System.Windows.Forms.TabPage()
		self._tabPage4 = System.Windows.Forms.TabPage()
		self._tabPage5 = System.Windows.Forms.TabPage()
		self._gb_Action = System.Windows.Forms.GroupBox()
		self._btn_Edit_VL = System.Windows.Forms.Button()
		self._btn_Suppress_VL = System.Windows.Forms.Button()
		self._btn_Delete_VL = System.Windows.Forms.Button()
		self._btn_Add_VL = System.Windows.Forms.Button()
		self._cbb_TypeMaterial = System.Windows.Forms.ComboBox()
		self._label1 = System.Windows.Forms.Label()
		self._gb_VL_SAN_HO = System.Windows.Forms.GroupBox()
		self._label2 = System.Windows.Forms.Label()
		self._label3 = System.Windows.Forms.Label()
		self._label4 = System.Windows.Forms.Label()
		self._label5 = System.Windows.Forms.Label()
		self._label6 = System.Windows.Forms.Label()
		self._txt_VL_SAN_HO_E = System.Windows.Forms.TextBox()
		self._txt_VL_SAN_HO_V = System.Windows.Forms.TextBox()
		self._txt_VL_SAN_HO_MD = System.Windows.Forms.TextBox()
		self._txt_VL_SAN_HO_MS = System.Windows.Forms.TextBox()
		self._txt_VL_SAN_HO_TSC = System.Windows.Forms.TextBox()
		self._label7 = System.Windows.Forms.Label()
		self._label8 = System.Windows.Forms.Label()
		self._btn_ADD_VL_SANHO = System.Windows.Forms.Button()
		self._gb_VL_NEN = System.Windows.Forms.GroupBox()
		self._txt_VL_NEN_E = System.Windows.Forms.TextBox()
		self._txt_VL_NEN_MD = System.Windows.Forms.TextBox()
		self._txt_VL_NEN_V = System.Windows.Forms.TextBox()
		self._label9 = System.Windows.Forms.Label()
		self._label10 = System.Windows.Forms.Label()
		self._label11 = System.Windows.Forms.Label()
		self._label12 = System.Windows.Forms.Label()
		self._label13 = System.Windows.Forms.Label()
		self._comboBox_VL_Choice_VL = System.Windows.Forms.ComboBox()
		self._label_VL_Choice_VL = System.Windows.Forms.Label()
		
		self._txt_VL_NEN_USK_GH = System.Windows.Forms.TextBox()
		self._txt_VL_NEN_USN_GH = System.Windows.Forms.TextBox()
		self._txt_VL_NEN_USK_PH = System.Windows.Forms.TextBox()
		self._label_VL_CT_K = System.Windows.Forms.Label()
		self._label_VL_CT_N = System.Windows.Forms.Label()
		self._label_VL_CT_PH = System.Windows.Forms.Label()
		self._label_UNIT_VL_CT_K = System.Windows.Forms.Label()
		self._label_UNIT_VL_CT_N = System.Windows.Forms.Label()
		self._label_UNIT_VL_CT_PH = System.Windows.Forms.Label()
		self._btn_VL_NEN_OK = System.Windows.Forms.Button()
		self._label14 = System.Windows.Forms.Label()
		self._txt_VL_SAN_HO_TSC_1 = System.Windows.Forms.TextBox()
		self._txt_VL_NEN_NAME = System.Windows.Forms.TextBox()
		self._label15 = System.Windows.Forms.Label()
		self._label16 = System.Windows.Forms.Label()
		self._txt_VL_SAN_HO_NAME = System.Windows.Forms.TextBox()
		self._btn_LIST_VL = System.Windows.Forms.Button()
		self._btn_VL_SELECT_VL = System.Windows.Forms.Button()
		self._lb_ListMaterial = System.Windows.Forms.ListView()
		self._col_Stt = System.Windows.Forms.ColumnHeader()
		self._E = System.Windows.Forms.ColumnHeader()
		self._P = System.Windows.Forms.ColumnHeader()
		self._KLR = System.Windows.Forms.ColumnHeader()
		self._col_Name = System.Windows.Forms.ColumnHeader()
		self._btn_Unsppress_VL = System.Windows.Forms.Button()
		#------------------  Giao dien cho MO HINH HINH HOC ----------------------------#
		self._pic_MHHH = System.Windows.Forms.PictureBox()
		self._btn_MHHH_OK = System.Windows.Forms.Button()
		self._tabControl_MHHH = System.Windows.Forms.TabControl()
		self._tabPage6 = System.Windows.Forms.TabPage()
		self._tabPage7 = System.Windows.Forms.TabPage()
		self._tabPage8 = System.Windows.Forms.TabPage()
		self._txt_MHHH_X = System.Windows.Forms.TextBox()
		self._txt_MHHH_Y = System.Windows.Forms.TextBox()
		self._txt_MHHH_R1 = System.Windows.Forms.TextBox()
		self._label_MHHH_X = System.Windows.Forms.Label()
		self._label_MHHH_Y = System.Windows.Forms.Label()
		self._label_MHHH_R1 = System.Windows.Forms.Label()
		self._txt_MHHH_B1 = System.Windows.Forms.TextBox()
		self._txt_MHHH_H1 = System.Windows.Forms.TextBox()
		self._txt_MHHH_D1 = System.Windows.Forms.TextBox()
		self._txt_MHHH_N1 = System.Windows.Forms.TextBox()
		self._txt_MHHH_T1 = System.Windows.Forms.TextBox()
		self._txt_MHHH_T2 = System.Windows.Forms.TextBox()
		self._txt_MHHH_S1 = System.Windows.Forms.TextBox()
		self._label_MHHH_B1 = System.Windows.Forms.Label()
		self._label_MHHH_H1 = System.Windows.Forms.Label()
		self._label_MHHH_D1 = System.Windows.Forms.Label()
		self._label_MHHH_N1 = System.Windows.Forms.Label()
		self._label_MHHH_T1 = System.Windows.Forms.Label()
		self._label_MHHH_T2 = System.Windows.Forms.Label()
		self._label_MHHH_S1 = System.Windows.Forms.Label()
		self._txt_MHHH_R = System.Windows.Forms.TextBox()
		self._txt_MHHH_H = System.Windows.Forms.TextBox()
		self._txt_MHHH_L1 = System.Windows.Forms.TextBox()
		self._txt_MHHH_L2 = System.Windows.Forms.TextBox()
		self._label_MHHH_R = System.Windows.Forms.Label()
		self._label_MHHH_H = System.Windows.Forms.Label()
		self._label_MHHH_L1 = System.Windows.Forms.Label()
		self._label_MHHH_L2 = System.Windows.Forms.Label()
		self._groupBox_MHHH_OC_CN = System.Windows.Forms.GroupBox()
		self._groupBox_MHHH_OC_T = System.Windows.Forms.GroupBox()
		self._label_MHHH_R01 = System.Windows.Forms.Label()
		self._label_MHHH_R02 = System.Windows.Forms.Label()
		self._label_MHHH_S2 = System.Windows.Forms.Label()
		self._txt_MHHH_R01 = System.Windows.Forms.TextBox()
		self._txt_MHHH_R02 = System.Windows.Forms.TextBox()
		self._txt_MHHH_S2 = System.Windows.Forms.TextBox()
		self._label_MHHH_R2 = System.Windows.Forms.Label()
		self._txt_MHHH_R2 = System.Windows.Forms.TextBox()
		self._label_MHHH_Rt = System.Windows.Forms.Label()
		self._txt_MHHH_Rt = System.Windows.Forms.TextBox()
		# --------------------------End giao dien MO HINH HINH HOC --------------------#
		self._tabControl1.SuspendLayout()
		self._tabPage2.SuspendLayout()
		self._tabPage1.SuspendLayout()
		self._gb_Action.SuspendLayout()
		self._pic_MHHH.BeginInit()
		self._gb_VL_SAN_HO.SuspendLayout()
		self._gb_VL_NEN.SuspendLayout()
		self._tabControl_MHHH.SuspendLayout()
		self._tabPage6.SuspendLayout()
		self._tabPage7.SuspendLayout()
		self._tabPage8.SuspendLayout()
		self.SuspendLayout()
		# 
		# tabControl1
		# 
		self._tabControl1.Controls.Add(self._tabPage1)
		self._tabControl1.Controls.Add(self._tabPage2)
		self._tabControl1.Controls.Add(self._tabPage3)
		self._tabControl1.Controls.Add(self._tabPage4)
		self._tabControl1.Controls.Add(self._tabPage5)
		self._tabControl1.Location = System.Drawing.Point(6, -1)
		self._tabControl1.Name = "tabControl1"
		self._tabControl1.SelectedIndex = 0
		self._tabControl1.Size = System.Drawing.Size(983, 473)
		self._tabControl1.TabIndex = 0
		# 
		# tabPage1
		# 
		self._tabPage1.Controls.Add(self._label_VL_Choice_VL)
		self._tabPage1.Controls.Add(self._comboBox_VL_Choice_VL)
		self._tabPage1.Controls.Add(self._lb_ListMaterial)
		self._tabPage1.Controls.Add(self._btn_VL_SELECT_VL)
		self._tabPage1.Controls.Add(self._gb_VL_SAN_HO)
		self._tabPage1.Controls.Add(self._label1)
		self._tabPage1.Controls.Add(self._gb_VL_NEN)
		self._tabPage1.Controls.Add(self._cbb_TypeMaterial)
		self._tabPage1.Controls.Add(self._gb_Action)
		self._tabPage1.Font = System.Drawing.Font("Microsoft Sans Serif", 11.25, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0)
		self._tabPage1.Location = System.Drawing.Point(4, 22)
		self._tabPage1.Name = "tabPage1"
		self._tabPage1.Padding = System.Windows.Forms.Padding(3)
		self._tabPage1.Size = System.Drawing.Size(975, 447)
		self._tabPage1.TabIndex = 0
		self._tabPage1.Text = "VẬT LIỆU"
		self._tabPage1.UseVisualStyleBackColor = True
		# 
		# tabPage2
		# 
		self._tabPage2.Controls.Add(self._tabControl_MHHH)
		self._tabPage2.Controls.Add(self._btn_MHHH_OK)
		self._tabPage2.Controls.Add(self._pic_MHHH)
		self._tabPage2.Location = System.Drawing.Point(4, 22)
		self._tabPage2.Name = "tabPage2"
		self._tabPage2.Padding = System.Windows.Forms.Padding(3)
		self._tabPage2.Size = System.Drawing.Size(975, 447)
		self._tabPage2.TabIndex = 1
		self._tabPage2.Text = "MÔ HÌNH HÌNH HỌC"
		self._tabPage2.UseVisualStyleBackColor = True
		# 
		# tabPage3
		# 
		self._tabPage3.Location = System.Drawing.Point(4, 22)
		self._tabPage3.Name = "tabPage3"
		self._tabPage3.Padding = System.Windows.Forms.Padding(3)
		self._tabPage3.Size = System.Drawing.Size(975, 447)
		self._tabPage3.TabIndex = 2
		self._tabPage3.Text = "ĐIỀU KHIỂN LƯỚI"
		self._tabPage3.UseVisualStyleBackColor = True
		# 
		# tabPage4
		# 
		self._tabPage4.Location = System.Drawing.Point(4, 22)
		self._tabPage4.Name = "tabPage4"
		self._tabPage4.Padding = System.Windows.Forms.Padding(3)
		self._tabPage4.Size = System.Drawing.Size(975, 447)
		self._tabPage4.TabIndex = 3
		self._tabPage4.Text = "KẾT QUẢ SỬ DỤNG BỘ GIẢI AUTODYN"
		self._tabPage4.UseVisualStyleBackColor = True
		# 
		# tabPage5
		# 
		self._tabPage5.Location = System.Drawing.Point(4, 22)
		self._tabPage5.Name = "tabPage5"
		self._tabPage5.Padding = System.Windows.Forms.Padding(3)
		self._tabPage5.Size = System.Drawing.Size(975, 447)
		self._tabPage5.TabIndex = 4
		self._tabPage5.Text = "BIỂU ĐỒ ĐÁNH GIÁ"
		self._tabPage5.UseVisualStyleBackColor = True
		# 
		# gb_Action
		# 
		self._gb_Action.Controls.Add(self._btn_LIST_VL)
		self._gb_Action.Controls.Add(self._btn_Edit_VL)
		self._gb_Action.Controls.Add(self._btn_Suppress_VL)
		self._gb_Action.Controls.Add(self._btn_Delete_VL)
		self._gb_Action.Controls.Add(self._btn_Add_VL)
		self._gb_Action.Controls.Add(self._btn_Unsppress_VL)
		self._gb_Action.Location = System.Drawing.Point(513, 31)
		self._gb_Action.Name = "gb_Action"
		self._gb_Action.Size = System.Drawing.Size(392, 364)
		self._gb_Action.TabIndex = 15
		self._gb_Action.TabStop = False
		self._gb_Action.Text = "Tác Vụ"
		# 
		# comboBox_VL_Choice_VL
		# 
		self._comboBox_VL_Choice_VL.FormattingEnabled = True
		self._comboBox_VL_Choice_VL.Items.AddRange(System.Array[System.Object](
			["Vật liệu nền san hô - Lớp 1",
			"Vật liệu nền san hô - Lớp 2",
			"Vật liệu nền san hô - Lớp 3",
			"Vật liệu công trình",
			"Vật liệu khối nổ"]))
		self._comboBox_VL_Choice_VL.Location = System.Drawing.Point(219, 412)
		self._comboBox_VL_Choice_VL.Name = "comboBox_VL_Choice_VL"
		self._comboBox_VL_Choice_VL.Size = System.Drawing.Size(121, 26)
		self._comboBox_VL_Choice_VL.TabIndex = 22
		# 
		# label_VL_Choice_VL
		# 
		self._label_VL_Choice_VL.Location = System.Drawing.Point(61, 415)
		self._label_VL_Choice_VL.Name = "label_VL_Choice_VL"
		self._label_VL_Choice_VL.Size = System.Drawing.Size(152, 23)
		self._label_VL_Choice_VL.TabIndex = 23
		self._label_VL_Choice_VL.Text = "Lựa chọn loại vật liệu"
		# 
		# btn_Edit_VL
		# 
		self._btn_Edit_VL.Location = System.Drawing.Point(26, 107)
		self._btn_Edit_VL.Name = "btn_Edit_VL"
		self._btn_Edit_VL.Size = System.Drawing.Size(164, 27)
		self._btn_Edit_VL.TabIndex = 3
		self._btn_Edit_VL.Text = "Chỉnh Sửa Vật Liệu"
		self._btn_Edit_VL.UseVisualStyleBackColor = True
		self._btn_Edit_VL.Click += self.Btn_Edit_VLClick
		# 
		# btn_Suppress_VL
		# 
		self._btn_Suppress_VL.Location = System.Drawing.Point(26, 257)
		self._btn_Suppress_VL.Name = "btn_Suppress_VL"
		self._btn_Suppress_VL.Size = System.Drawing.Size(164, 31)
		self._btn_Suppress_VL.TabIndex = 2
		self._btn_Suppress_VL.Text = "Ẩn Vật Liệu"
		self._btn_Suppress_VL.UseVisualStyleBackColor = True
		self._btn_Suppress_VL.Click += self.Btn_Suppress_VLClick
		# 
		# btn_Delete_VL
		# 
		self._btn_Delete_VL.Location = System.Drawing.Point(26, 182)
		self._btn_Delete_VL.Name = "btn_Delete_VL"
		self._btn_Delete_VL.Size = System.Drawing.Size(164, 30)
		self._btn_Delete_VL.TabIndex = 1
		self._btn_Delete_VL.Text = "Xóa Vật Liệu"
		self._btn_Delete_VL.UseVisualStyleBackColor = True
		self._btn_Delete_VL.Click += self.Btn_Delete_VLClick
		# 
		# btn_Add_VL
		# 
		self._btn_Add_VL.Location = System.Drawing.Point(26, 31)
		self._btn_Add_VL.Name = "btn_Add_VL"
		self._btn_Add_VL.Size = System.Drawing.Size(164, 29)
		self._btn_Add_VL.TabIndex = 0
		self._btn_Add_VL.Text = "Thêm Vật Liệu"
		self._btn_Add_VL.UseVisualStyleBackColor = True
		self._btn_Add_VL.Click += self.Btn_Add_VLClick
		# 
		# btn_Unsppress_VL
		# 
		self._btn_Unsppress_VL.Location = System.Drawing.Point(26, 324)
		self._btn_Unsppress_VL.Name = "btn_Unsppress_VL"
		self._btn_Unsppress_VL.Size = System.Drawing.Size(164, 30)
		self._btn_Unsppress_VL.TabIndex = 5
		self._btn_Unsppress_VL.Text = "Hiện Vật Liệu"
		self._btn_Unsppress_VL.UseVisualStyleBackColor = True
		self._btn_Unsppress_VL.Click += self.Btn_Unsppress_VLClick
		# 
		# cbb_TypeMaterial
		# 
		self._cbb_TypeMaterial.FormattingEnabled = True
		self._cbb_TypeMaterial.Items.AddRange(System.Array[System.Object](
			["Vật liệu nền san hô",
			"Vật liệu làm công trình"]))
		self._cbb_TypeMaterial.Location = System.Drawing.Point(116, 3)
		self._cbb_TypeMaterial.Name = "cbb_TypeMaterial"
		self._cbb_TypeMaterial.Size = System.Drawing.Size(121, 26)
		self._cbb_TypeMaterial.TabIndex = 17
		self._cbb_TypeMaterial.SelectedIndexChanged += self.Cbb_TypeMaterialSelectedIndexChanged
		# 
		# label1
		# 
		self._label1.Location = System.Drawing.Point(20, 6)
		self._label1.Name = "label1"
		self._label1.Size = System.Drawing.Size(100, 23)
		self._label1.TabIndex = 18
		self._label1.Text = "Loại vật liệu :"
		# 
		# gb_VL_SAN_HO
		# 
		self._gb_VL_SAN_HO.Controls.Add(self._txt_VL_SAN_HO_NAME)
		self._gb_VL_SAN_HO.Controls.Add(self._label16)
		self._gb_VL_SAN_HO.Controls.Add(self._label15)
		self._gb_VL_SAN_HO.Controls.Add(self._btn_ADD_VL_SANHO)
		self._gb_VL_SAN_HO.Controls.Add(self._label8)
		self._gb_VL_SAN_HO.Controls.Add(self._label7)
		self._gb_VL_SAN_HO.Controls.Add(self._txt_VL_SAN_HO_TSC)
		self._gb_VL_SAN_HO.Controls.Add(self._txt_VL_SAN_HO_TSC_1)
		self._gb_VL_SAN_HO.Controls.Add(self._txt_VL_SAN_HO_MS)
		self._gb_VL_SAN_HO.Controls.Add(self._txt_VL_SAN_HO_MD)
		self._gb_VL_SAN_HO.Controls.Add(self._txt_VL_SAN_HO_V)
		self._gb_VL_SAN_HO.Controls.Add(self._txt_VL_SAN_HO_E)
		self._gb_VL_SAN_HO.Controls.Add(self._label6)
		self._gb_VL_SAN_HO.Controls.Add(self._label5)
		self._gb_VL_SAN_HO.Controls.Add(self._label4)
		self._gb_VL_SAN_HO.Controls.Add(self._label3)
		self._gb_VL_SAN_HO.Controls.Add(self._label2)
		self._gb_VL_SAN_HO.Font = System.Drawing.Font("Microsoft Sans Serif", 9.75, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0)
		self._gb_VL_SAN_HO.Location = System.Drawing.Point(3, 42)
		self._gb_VL_SAN_HO.Name = "gb_VL_SAN_HO"
		self._gb_VL_SAN_HO.Size = System.Drawing.Size(493, 363)
		self._gb_VL_SAN_HO.TabIndex = 19
		self._gb_VL_SAN_HO.TabStop = False
		self._gb_VL_SAN_HO.Text = "THÔNG SỐ VẬT LIỆU NỀN SAN - HÔ"
		self._gb_VL_SAN_HO.Visible = False
		# 
		# label2
		# 
		self._label2.Location = System.Drawing.Point(18, 89)
		self._label2.Name = "label2"
		self._label2.Size = System.Drawing.Size(122, 23)
		self._label2.TabIndex = 0
		self._label2.Text = "Mô dun đàn hồi E"
		# 
		# label3
		# 
		self._label3.Location = System.Drawing.Point(18, 130)
		self._label3.Name = "label3"
		self._label3.Size = System.Drawing.Size(100, 23)
		self._label3.TabIndex = 1
		self._label3.Text = "Hệ số v"
		# 
		# label4
		# 
		self._label4.Location = System.Drawing.Point(18, 174)
		self._label4.Name = "label4"
		self._label4.Size = System.Drawing.Size(100, 23)
		self._label4.TabIndex = 2
		self._label4.Text = "Mật độ"
		# 
		# label5
		# 
		self._label5.Location = System.Drawing.Point(18, 218)
		self._label5.Name = "label5"
		self._label5.Size = System.Drawing.Size(166, 23)
		self._label5.TabIndex = 3
		self._label5.Text = "Hệ số ma sát với Bê tông"
		# 
		# label6
		# 
		self._label6.Location = System.Drawing.Point(18, 254)
		self._label6.Name = "label6"
		self._label6.Size = System.Drawing.Size(139, 23)
		self._label6.TabIndex = 4
		self._label6.Text = "Hệ số tắt dần alpha"
		# 
		# txt_VL_SAN_HO_TSC_1
		# 
		self._txt_VL_SAN_HO_TSC_1.Location = System.Drawing.Point(190, 301)
		self._txt_VL_SAN_HO_TSC_1.Name = "txt_VL_SAN_HO_TSC_1"
		self._txt_VL_SAN_HO_TSC_1.Size = System.Drawing.Size(100, 22)
		self._txt_VL_SAN_HO_TSC_1.TabIndex = 23
		# 
		# label16
		# 
		self._label16.Location = System.Drawing.Point(20, 299)
		self._label16.Name = "label16"
		self._label16.Size = System.Drawing.Size(120, 23)
		self._label16.TabIndex = 24
		self._label16.Text = "Hệ số tắt dần beta"
		# 
		# txt_VL_SAN_HO_E
		# 
		self._txt_VL_SAN_HO_E.Location = System.Drawing.Point(190, 85)
		self._txt_VL_SAN_HO_E.Name = "txt_VL_SAN_HO_E"
		self._txt_VL_SAN_HO_E.Size = System.Drawing.Size(100, 22)
		self._txt_VL_SAN_HO_E.TabIndex = 5
		# 
		# txt_VL_SAN_HO_V
		# 
		self._txt_VL_SAN_HO_V.Location = System.Drawing.Point(190, 131)
		self._txt_VL_SAN_HO_V.Name = "txt_VL_SAN_HO_V"
		self._txt_VL_SAN_HO_V.Size = System.Drawing.Size(100, 22)
		self._txt_VL_SAN_HO_V.TabIndex = 6
		# 
		# txt_VL_SAN_HO_MD
		# 
		self._txt_VL_SAN_HO_MD.Location = System.Drawing.Point(190, 171)
		self._txt_VL_SAN_HO_MD.Name = "txt_VL_SAN_HO_MD"
		self._txt_VL_SAN_HO_MD.Size = System.Drawing.Size(100, 22)
		self._txt_VL_SAN_HO_MD.TabIndex = 7
		# 
		# txt_VL_SAN_HO_MS
		# 
		self._txt_VL_SAN_HO_MS.Location = System.Drawing.Point(190, 215)
		self._txt_VL_SAN_HO_MS.Name = "txt_VL_SAN_HO_MS"
		self._txt_VL_SAN_HO_MS.Size = System.Drawing.Size(100, 22)
		self._txt_VL_SAN_HO_MS.TabIndex = 8
		# 
		# txt_VL_SAN_HO_TSC
		# 
		self._txt_VL_SAN_HO_TSC.Location = System.Drawing.Point(190, 256)
		self._txt_VL_SAN_HO_TSC.Name = "txt_VL_SAN_HO_TSC"
		self._txt_VL_SAN_HO_TSC.Size = System.Drawing.Size(100, 22)
		self._txt_VL_SAN_HO_TSC.TabIndex = 9
		# 
		# label7
		# 
		self._label7.Location = System.Drawing.Point(320, 85)
		self._label7.Name = "label7"
		self._label7.Size = System.Drawing.Size(100, 23)
		self._label7.TabIndex = 10
		self._label7.Text = "MPa"
		# 
		# label8
		# 
		self._label8.Location = System.Drawing.Point(320, 170)
		self._label8.Name = "label8"
		self._label8.Size = System.Drawing.Size(100, 23)
		self._label8.TabIndex = 11
		self._label8.Text = "kg/m^3"
		# 
		# btn_ADD_VL_SANHO
		# 
		self._btn_ADD_VL_SANHO.Location = System.Drawing.Point(215, 329)
		self._btn_ADD_VL_SANHO.Name = "btn_ADD_VL_SANHO"
		self._btn_ADD_VL_SANHO.Size = System.Drawing.Size(75, 24)
		self._btn_ADD_VL_SANHO.TabIndex = 13
		self._btn_ADD_VL_SANHO.Text = "OK"
		self._btn_ADD_VL_SANHO.UseVisualStyleBackColor = True
		self._btn_ADD_VL_SANHO.Click += self.Btn_ADD_VL_SANHOClick
		# 
		# gb_VL_NEN
		# 
		self._gb_VL_NEN.Controls.Add(self._label_UNIT_VL_CT_PH)
		self._gb_VL_NEN.Controls.Add(self._label_UNIT_VL_CT_N)
		self._gb_VL_NEN.Controls.Add(self._label_UNIT_VL_CT_K)
		self._gb_VL_NEN.Controls.Add(self._label_VL_CT_PH)
		self._gb_VL_NEN.Controls.Add(self._label_VL_CT_N)
		self._gb_VL_NEN.Controls.Add(self._label_VL_CT_K)
		self._gb_VL_NEN.Controls.Add(self._txt_VL_NEN_USK_PH)
		self._gb_VL_NEN.Controls.Add(self._txt_VL_NEN_USN_GH)
		self._gb_VL_NEN.Controls.Add(self._txt_VL_NEN_USK_GH)
		self._gb_VL_NEN.Controls.Add(self._txt_VL_NEN_NAME)
		self._gb_VL_NEN.Controls.Add(self._label14)
		self._gb_VL_NEN.Controls.Add(self._btn_VL_NEN_OK)
		self._gb_VL_NEN.Controls.Add(self._label13)
		self._gb_VL_NEN.Controls.Add(self._label12)
		self._gb_VL_NEN.Controls.Add(self._label11)
		self._gb_VL_NEN.Controls.Add(self._label10)
		self._gb_VL_NEN.Controls.Add(self._label9)
		self._gb_VL_NEN.Controls.Add(self._txt_VL_NEN_V)
		self._gb_VL_NEN.Controls.Add(self._txt_VL_NEN_MD)
		self._gb_VL_NEN.Controls.Add(self._txt_VL_NEN_E)
		self._gb_VL_NEN.Location = System.Drawing.Point(6, 42)
		self._gb_VL_NEN.Name = "gb_VL_NEN"
		self._gb_VL_NEN.Size = System.Drawing.Size(487, 363)
		self._gb_VL_NEN.TabIndex = 20
		self._gb_VL_NEN.TabStop = False
		self._gb_VL_NEN.Text = "THÔNG SỐ VẬT LIỆU LÀM CÔNG TRÌNH"
		self._gb_VL_NEN.Visible = False
		# 
		# txt_VL_NEN_E
		# 
		self._txt_VL_NEN_E.Location = System.Drawing.Point(196, 85)
		self._txt_VL_NEN_E.Name = "txt_VL_NEN_E"
		self._txt_VL_NEN_E.Size = System.Drawing.Size(100, 24)
		self._txt_VL_NEN_E.TabIndex = 0
		# 
		# txt_
		# 
		self._txt_VL_NEN_MD.Location = System.Drawing.Point(196, 174)
		self._txt_VL_NEN_MD.Name = "txt_VL_NEN_MD"
		self._txt_VL_NEN_MD.Size = System.Drawing.Size(100, 24)
		self._txt_VL_NEN_MD.TabIndex = 1
		# 
		# txt_VL_NEN_V
		# 
		self._txt_VL_NEN_V.Location = System.Drawing.Point(196, 131)
		self._txt_VL_NEN_V.Name = "txt_VL_NEN_V"
		self._txt_VL_NEN_V.Size = System.Drawing.Size(100, 24)
		self._txt_VL_NEN_V.TabIndex = 2
		# 
		# label9
		# 
		self._label9.Location = System.Drawing.Point(29, 85)
		self._label9.Name = "label9"
		self._label9.Size = System.Drawing.Size(126, 23)
		self._label9.TabIndex = 3
		self._label9.Text = "Mô đun đàn hồi E"
		# 
		# label10
		# 
		self._label10.Location = System.Drawing.Point(29, 128)
		self._label10.Name = "label10"
		self._label10.Size = System.Drawing.Size(100, 23)
		self._label10.TabIndex = 4
		self._label10.Text = "Hệ số v"
		# 
		# label11
		# 
		self._label11.Location = System.Drawing.Point(29, 172)
		self._label11.Name = "label11"
		self._label11.Size = System.Drawing.Size(100, 23)
		self._label11.TabIndex = 5
		self._label11.Text = "Mật độ"
		# 
		# label12
		# 
		self._label12.Location = System.Drawing.Point(333, 89)
		self._label12.Name = "label12"
		self._label12.Size = System.Drawing.Size(100, 23)
		self._label12.TabIndex = 6
		self._label12.Text = "MPa"
		# 
		# label13
		# 
		self._label13.Location = System.Drawing.Point(333, 178)
		self._label13.Name = "label13"
		self._label13.Size = System.Drawing.Size(100, 23)
		self._label13.TabIndex = 7
		self._label13.Text = "kg/m^3"
		# 
		# btn_VL_NEN_OK
		# 
		self._btn_VL_NEN_OK.Location = System.Drawing.Point(192, 328)
		self._btn_VL_NEN_OK.Name = "btn_VL_NEN_OK"
		self._btn_VL_NEN_OK.Size = System.Drawing.Size(85, 25)
		self._btn_VL_NEN_OK.TabIndex = 8
		self._btn_VL_NEN_OK.Text = "OK"
		self._btn_VL_NEN_OK.UseVisualStyleBackColor = True
		self._btn_VL_NEN_OK.Click += self.Btn_VL_NEN_OKClick	
		# 
		# label14
		# 
		self._label14.Location = System.Drawing.Point(29, 35)
		self._label14.Name = "label14"
		self._label14.Size = System.Drawing.Size(100, 23)
		self._label14.TabIndex = 9
		self._label14.Text = "Tên vật liệu"
		# 
		# txt_VL_NEN_NAME
		# 
		self._txt_VL_NEN_NAME.Location = System.Drawing.Point(196, 38)
		self._txt_VL_NEN_NAME.Name = "txt_VL_NEN_NAME"
		self._txt_VL_NEN_NAME.Size = System.Drawing.Size(224, 24)
		self._txt_VL_NEN_NAME.TabIndex = 10
		# 
		# label15
		# 
		self._label15.Location = System.Drawing.Point(20, 41)
		self._label15.Name = "label15"
		self._label15.Size = System.Drawing.Size(100, 23)
		self._label15.TabIndex = 21
		self._label15.Text = "Tên vật liệu"
		# 
		# txt_VL_SAN_HO_NAME
		# 
		self._txt_VL_SAN_HO_NAME.Location = System.Drawing.Point(190, 39)
		self._txt_VL_SAN_HO_NAME.Name = "txt_VL_SAN_HO_NAME"
		self._txt_VL_SAN_HO_NAME.Size = System.Drawing.Size(220, 22)
		self._txt_VL_SAN_HO_NAME.TabIndex = 22
		# 
		# btn_LIST_VL
		# 
		self._btn_LIST_VL.Location = System.Drawing.Point(221, 161)
		self._btn_LIST_VL.Name = "btn_LIST_VL"
		self._btn_LIST_VL.Size = System.Drawing.Size(165, 32)
		self._btn_LIST_VL.TabIndex = 4
		self._btn_LIST_VL.Text = "Danh Sách Vật Liệu"
		self._btn_LIST_VL.UseVisualStyleBackColor = True
		self._btn_LIST_VL.Click += self.Btn_LIST_VLClick
		# 
		# btn_VL_SELECT_VL
		# 
		self._btn_VL_SELECT_VL.Location = System.Drawing.Point(382, 411)
		self._btn_VL_SELECT_VL.Name = "btn_VL_SELECT_VL"
		self._btn_VL_SELECT_VL.Size = System.Drawing.Size(111, 27)
		self._btn_VL_SELECT_VL.TabIndex = 21
		self._btn_VL_SELECT_VL.Text = "Chọn Vật Liệu"
		self._btn_VL_SELECT_VL.UseVisualStyleBackColor = True
		self._btn_VL_SELECT_VL.Click += self.Btn_VL_SELECT_VLClick
		# 
		# lb_ListMaterial
		# 
		self._lb_ListMaterial.Columns.AddRange(System.Array[System.Windows.Forms.ColumnHeader](
			[self._col_Stt,
			self._col_Name,
			self._E,
			self._P,
			self._KLR]))
		self._lb_ListMaterial.Location = System.Drawing.Point(0, 42)
		self._lb_ListMaterial.Name = "lb_ListMaterial"
		self._lb_ListMaterial.Size = System.Drawing.Size(497, 363)
		self._lb_ListMaterial.TabIndex = 22
		self._lb_ListMaterial.UseCompatibleStateImageBehavior = False
		self._lb_ListMaterial.View = System.Windows.Forms.View.Details
		self._lb_ListMaterial.CheckBoxes = True
		self._lb_ListMaterial.MultiSelect = False
		# 
		# col_Stt
		# 
		self._col_Stt.Text = "Stt"
		self._col_Stt.Width = 47
		# 
		# E
		# 
		self._E.Text = "Module E (Mpa)"
		self._E.Width = 78
		# 
		# P
		# 
		self._P.Text = "Hệ số Poison"
		self._P.Width = 112
		# 
		# KLR
		# 
		self._KLR.Text = "Khối Lượng Riêng (kg/m^3)"
		self._KLR.Width = 218
		# 
		# col_Name
		# 
		self._col_Name.Text = "Tên Vật Liệu"
		self._col_Name.Width = 120
		
		# ------------------------ Start controls cua MHHH ----------------------- #
		# 
		# pic_MHHH
		# 
		self._pic_MHHH.Location = System.Drawing.Point(389, 3)
		self._pic_MHHH.Name = "pic_MHHH"
		self._pic_MHHH.Size = System.Drawing.Size(584, 285)
		self._pic_MHHH.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
		self._pic_MHHH.TabIndex = 0
		self._pic_MHHH.TabStop = False
		# 
		# btn_MHHH_OK
		# 
		self._btn_MHHH_OK.Location = System.Drawing.Point(639, 356)
		self._btn_MHHH_OK.Name = "btn_MHHH_OK"
		self._btn_MHHH_OK.Size = System.Drawing.Size(103, 32)
		self._btn_MHHH_OK.TabIndex = 2
		self._btn_MHHH_OK.Text = "Cập nhật mô hình"
		self._btn_MHHH_OK.UseVisualStyleBackColor = True
		self._btn_MHHH_OK.Click += self.Btn_MHHH_OKClick
		# 
		# tabControl_MHHH
		# 
		self._tabControl_MHHH.Controls.Add(self._tabPage6)
		self._tabControl_MHHH.Controls.Add(self._tabPage7)
		self._tabControl_MHHH.Controls.Add(self._tabPage8)
		self._tabControl_MHHH.Location = System.Drawing.Point(0, 7)
		self._tabControl_MHHH.Name = "tabControl_MHHH"
		self._tabControl_MHHH.SelectedIndex = 0
		self._tabControl_MHHH.Size = System.Drawing.Size(387, 440)
		self._tabControl_MHHH.TabIndex = 3
		# 
		# tabPage6
		# 
		self._tabPage6.Controls.Add(self._label_MHHH_L2)
		self._tabPage6.Controls.Add(self._label_MHHH_L1)
		self._tabPage6.Controls.Add(self._label_MHHH_H)
		self._tabPage6.Controls.Add(self._label_MHHH_R)
		self._tabPage6.Controls.Add(self._txt_MHHH_L2)
		self._tabPage6.Controls.Add(self._txt_MHHH_L1)
		self._tabPage6.Controls.Add(self._txt_MHHH_H)
		self._tabPage6.Controls.Add(self._txt_MHHH_R)
		self._tabPage6.Location = System.Drawing.Point(4, 22)
		self._tabPage6.Name = "tabPage6"
		self._tabPage6.Padding = System.Windows.Forms.Padding(3)
		self._tabPage6.Size = System.Drawing.Size(379, 414)
		self._tabPage6.TabIndex = 0
		self._tabPage6.Text = "KÍCH THƯỚC NỀN"
		self._tabPage6.UseVisualStyleBackColor = True
		# 
		# tabPage7
		# 
		self._tabPage7.Controls.Add(self._groupBox_MHHH_OC_T)
		self._tabPage7.Controls.Add(self._groupBox_MHHH_OC_CN)
		self._tabPage7.Location = System.Drawing.Point(4, 22)
		self._tabPage7.Name = "tabPage7"
		self._tabPage7.Padding = System.Windows.Forms.Padding(3)
		self._tabPage7.Size = System.Drawing.Size(379, 414)
		self._tabPage7.TabIndex = 1
		self._tabPage7.Text = "KÍCH THƯỚC CÔNG TRÌNH"
		self._tabPage7.UseVisualStyleBackColor = True
		# 
		# tabPage8
		# 
		self._tabPage8.Controls.Add(self._txt_MHHH_Rt)
		self._tabPage8.Controls.Add(self._label_MHHH_Rt)
		self._tabPage8.Controls.Add(self._label_MHHH_R2)
		self._tabPage8.Controls.Add(self._txt_MHHH_R2)
		self._tabPage8.Controls.Add(self._label_MHHH_R1)
		self._tabPage8.Controls.Add(self._label_MHHH_Y)
		self._tabPage8.Controls.Add(self._label_MHHH_X)
		self._tabPage8.Controls.Add(self._txt_MHHH_R1)
		self._tabPage8.Controls.Add(self._txt_MHHH_Y)
		self._tabPage8.Controls.Add(self._txt_MHHH_X)
		self._tabPage8.Location = System.Drawing.Point(4, 22)
		self._tabPage8.Name = "tabPage8"
		self._tabPage8.Padding = System.Windows.Forms.Padding(3)
		self._tabPage8.Size = System.Drawing.Size(379, 414)
		self._tabPage8.TabIndex = 2
		self._tabPage8.Text = "VỊ TRÍ KHỐI NỔ"
		self._tabPage8.UseVisualStyleBackColor = True
		# 
		# txt_MHHH_X
		# 
		self._txt_MHHH_X.Location = System.Drawing.Point(192, 32)
		self._txt_MHHH_X.Name = "txt_MHHH_X"
		self._txt_MHHH_X.Size = System.Drawing.Size(140, 20)
		self._txt_MHHH_X.TabIndex = 0
		self._txt_MHHH_X.Text = "30"
		# 
		# txt_MHHH_Y
		# 
		self._txt_MHHH_Y.Location = System.Drawing.Point(192, 81)
		self._txt_MHHH_Y.Name = "txt_MHHH_Y"
		self._txt_MHHH_Y.Size = System.Drawing.Size(140, 20)
		self._txt_MHHH_Y.TabIndex = 1
		self._txt_MHHH_Y.Text = "20"
		# 
		# txt_MHHH_R1
		# 
		self._txt_MHHH_R1.Location = System.Drawing.Point(238, 143)
		self._txt_MHHH_R1.Name = "txt_MHHH_R1"
		self._txt_MHHH_R1.Size = System.Drawing.Size(94, 20)
		self._txt_MHHH_R1.TabIndex = 2
		self._txt_MHHH_R1.Text = "12"
		# 
		# label_MHHH_X
		# 
		self._label_MHHH_X.Location = System.Drawing.Point(3, 29)
		self._label_MHHH_X.Name = "label_MHHH_X"
		self._label_MHHH_X.Size = System.Drawing.Size(156, 23)
		self._label_MHHH_X.TabIndex = 3
		self._label_MHHH_X.Text = "Tọa độ theo phương X : X (m)"
		# 
		# label_MHHH_Y
		# 
		self._label_MHHH_Y.Location = System.Drawing.Point(3, 78)
		self._label_MHHH_Y.Name = "label_MHHH_Y"
		self._label_MHHH_Y.Size = System.Drawing.Size(156, 23)
		self._label_MHHH_Y.TabIndex = 4
		self._label_MHHH_Y.Text = "Tọa độ theo phương Y: Y (m)"
		# 
		# label_MHHH_R1
		# 
		self._label_MHHH_R1.Location = System.Drawing.Point(6, 140)
		self._label_MHHH_R1.Name = "label_MHHH_R1"
		self._label_MHHH_R1.Size = System.Drawing.Size(226, 23)
		self._label_MHHH_R1.TabIndex = 5
		self._label_MHHH_R1.Text = "Khoảng cách đến ống cống chữ nhật: R1 (m)"
		# 
		# txt_MHHH_B1
		# 
		self._txt_MHHH_B1.Location = System.Drawing.Point(199, 20)
		self._txt_MHHH_B1.Name = "txt_MHHH_B1"
		self._txt_MHHH_B1.Size = System.Drawing.Size(118, 20)
		self._txt_MHHH_B1.TabIndex = 0
		self._txt_MHHH_B1.Text = "10"
		# 
		# txt_MHHH_H1
		# 
		self._txt_MHHH_H1.Location = System.Drawing.Point(199, 56)
		self._txt_MHHH_H1.Name = "txt_MHHH_H1"
		self._txt_MHHH_H1.Size = System.Drawing.Size(118, 20)
		self._txt_MHHH_H1.TabIndex = 1
		self._txt_MHHH_H1.Text = "8"
		# 
		# txt_MHHH_D1
		# 
		self._txt_MHHH_D1.Location = System.Drawing.Point(199, 93)
		self._txt_MHHH_D1.Name = "txt_MHHH_D1"
		self._txt_MHHH_D1.Size = System.Drawing.Size(118, 20)
		self._txt_MHHH_D1.TabIndex = 2
		self._txt_MHHH_D1.Text = "1"
		# 
		# txt_MHHH_N1
		# 
		self._txt_MHHH_N1.Location = System.Drawing.Point(199, 126)
		self._txt_MHHH_N1.Name = "txt_MHHH_N1"
		self._txt_MHHH_N1.Size = System.Drawing.Size(118, 20)
		self._txt_MHHH_N1.TabIndex = 3
		self._txt_MHHH_N1.Text = "1"
		# 
		# txt_MHHH_T1
		# 
		self._txt_MHHH_T1.Location = System.Drawing.Point(199, 167)
		self._txt_MHHH_T1.Name = "txt_MHHH_T1"
		self._txt_MHHH_T1.Size = System.Drawing.Size(118, 20)
		self._txt_MHHH_T1.TabIndex = 4
		self._txt_MHHH_T1.Text = "1"
		# 
		# txt_MHHH_T2
		# 
		self._txt_MHHH_T2.Location = System.Drawing.Point(199, 197)
		self._txt_MHHH_T2.Name = "txt_MHHH_T2"
		self._txt_MHHH_T2.Size = System.Drawing.Size(118, 20)
		self._txt_MHHH_T2.TabIndex = 5
		self._txt_MHHH_T2.Text = "1"
		# 
		# txt_MHHH_S1
		# 
		self._txt_MHHH_S1.Location = System.Drawing.Point(199, 233)
		self._txt_MHHH_S1.Name = "txt_MHHH_S1"
		self._txt_MHHH_S1.Size = System.Drawing.Size(118, 20)
		self._txt_MHHH_S1.TabIndex = 6
		self._txt_MHHH_S1.Text = "15"
		# 
		# label_MHHH_B1
		# 
		self._label_MHHH_B1.Location = System.Drawing.Point(14, 17)
		self._label_MHHH_B1.Name = "label_MHHH_B1"
		self._label_MHHH_B1.Size = System.Drawing.Size(142, 23)
		self._label_MHHH_B1.TabIndex = 7
		self._label_MHHH_B1.Text = "Chiều rộng ống cống: B1 (m)"
		# 
		# label_MHHH_H1
		# 
		self._label_MHHH_H1.Location = System.Drawing.Point(12, 53)
		self._label_MHHH_H1.Name = "label_MHHH_H1"
		self._label_MHHH_H1.Size = System.Drawing.Size(154, 23)
		self._label_MHHH_H1.TabIndex = 8
		self._label_MHHH_H1.Text = "Chiều cao ống cống: H1 (m)"
		# 
		# label_MHHH_D1
		# 
		self._label_MHHH_D1.Location = System.Drawing.Point(14, 93)
		self._label_MHHH_D1.Name = "label_MHHH_D1"
		self._label_MHHH_D1.Size = System.Drawing.Size(100, 23)
		self._label_MHHH_D1.TabIndex = 9
		self._label_MHHH_D1.Text = "Độ dày: D1 (m)"
		# 
		# label_MHHH_N1
		# 
		self._label_MHHH_N1.Location = System.Drawing.Point(14, 129)
		self._label_MHHH_N1.Name = "label_MHHH_N1"
		self._label_MHHH_N1.Size = System.Drawing.Size(100, 23)
		self._label_MHHH_N1.TabIndex = 10
		self._label_MHHH_N1.Text = "Độ dày: N1 (m)"
		# 
		# label_MHHH_T1
		# 
		self._label_MHHH_T1.Location = System.Drawing.Point(14, 164)
		self._label_MHHH_T1.Name = "label_MHHH_T1"
		self._label_MHHH_T1.Size = System.Drawing.Size(100, 23)
		self._label_MHHH_T1.TabIndex = 11
		self._label_MHHH_T1.Text = "Độ dày: T1 (m)"
		# 
		# label_MHHH_T2
		# 
		self._label_MHHH_T2.Location = System.Drawing.Point(12, 194)
		self._label_MHHH_T2.Name = "label_MHHH_T2"
		self._label_MHHH_T2.Size = System.Drawing.Size(100, 23)
		self._label_MHHH_T2.TabIndex = 12
		self._label_MHHH_T2.Text = "Độ dày: T2 (m)"
		# 
		# label_MHHH_S1
		# 
		self._label_MHHH_S1.Location = System.Drawing.Point(6, 230)
		self._label_MHHH_S1.Name = "label_MHHH_S1"
		self._label_MHHH_S1.Size = System.Drawing.Size(150, 23)
		self._label_MHHH_S1.TabIndex = 13
		self._label_MHHH_S1.Text = "Độ sâu với mặt nền: S1 (m)"
		# 
		# txt_MHHH_R
		# 
		self._txt_MHHH_R.Location = System.Drawing.Point(185, 23)
		self._txt_MHHH_R.Name = "txt_MHHH_R"
		self._txt_MHHH_R.Size = System.Drawing.Size(108, 20)
		self._txt_MHHH_R.TabIndex = 0
		self._txt_MHHH_R.Text = "60"
		# 
		# txt_MHHH_H
		# 
		self._txt_MHHH_H.Location = System.Drawing.Point(185, 73)
		self._txt_MHHH_H.Name = "txt_MHHH_H"
		self._txt_MHHH_H.Size = System.Drawing.Size(108, 20)
		self._txt_MHHH_H.TabIndex = 1
		self._txt_MHHH_H.Text = "40"
		# 
		# txt_MHHH_L1
		# 
		self._txt_MHHH_L1.Location = System.Drawing.Point(185, 121)
		self._txt_MHHH_L1.Name = "txt_MHHH_L1"
		self._txt_MHHH_L1.Size = System.Drawing.Size(108, 20)
		self._txt_MHHH_L1.TabIndex = 2
		self._txt_MHHH_L1.Text = "10"
		# 
		# txt_MHHH_L2
		# 
		self._txt_MHHH_L2.Location = System.Drawing.Point(185, 163)
		self._txt_MHHH_L2.Name = "txt_MHHH_L2"
		self._txt_MHHH_L2.Size = System.Drawing.Size(108, 20)
		self._txt_MHHH_L2.TabIndex = 3
		self._txt_MHHH_L2.Text = "10"
		# 
		# label_MHHH_R
		# 
		self._label_MHHH_R.Location = System.Drawing.Point(7, 23)
		self._label_MHHH_R.Name = "label_MHHH_R"
		self._label_MHHH_R.Size = System.Drawing.Size(162, 23)
		self._label_MHHH_R.TabIndex = 5
		self._label_MHHH_R.Text = "Chiều rộng vật liệu nền: R (m)"
		# 
		# label_MHHH_H
		# 
		self._label_MHHH_H.Location = System.Drawing.Point(7, 70)
		self._label_MHHH_H.Name = "label_MHHH_H"
		self._label_MHHH_H.Size = System.Drawing.Size(172, 23)
		self._label_MHHH_H.TabIndex = 6
		self._label_MHHH_H.Text = "Chiều cao của vật liệu nền: H (m)"
		# 
		# label_MHHH_L1
		# 
		self._label_MHHH_L1.Location = System.Drawing.Point(7, 118)
		self._label_MHHH_L1.Name = "label_MHHH_L1"
		self._label_MHHH_L1.Size = System.Drawing.Size(143, 23)
		self._label_MHHH_L1.TabIndex = 7
		self._label_MHHH_L1.Text = "Chiều dày lớp 1: L1 (m)"
		# 
		# label_MHHH_L2
		# 
		self._label_MHHH_L2.Location = System.Drawing.Point(7, 160)
		self._label_MHHH_L2.Name = "label_MHHH_L2"
		self._label_MHHH_L2.Size = System.Drawing.Size(143, 23)
		self._label_MHHH_L2.TabIndex = 8
		self._label_MHHH_L2.Text = "Chiều dày lớp 2: L2 (m)"
		# 
		# groupBox_MHHH_OC_CN
		# 
		self._groupBox_MHHH_OC_CN.Controls.Add(self._txt_MHHH_H1)
		self._groupBox_MHHH_OC_CN.Controls.Add(self._label_MHHH_S1)
		self._groupBox_MHHH_OC_CN.Controls.Add(self._txt_MHHH_B1)
		self._groupBox_MHHH_OC_CN.Controls.Add(self._label_MHHH_T2)
		self._groupBox_MHHH_OC_CN.Controls.Add(self._txt_MHHH_D1)
		self._groupBox_MHHH_OC_CN.Controls.Add(self._txt_MHHH_S1)
		self._groupBox_MHHH_OC_CN.Controls.Add(self._txt_MHHH_T2)
		self._groupBox_MHHH_OC_CN.Controls.Add(self._label_MHHH_T1)
		self._groupBox_MHHH_OC_CN.Controls.Add(self._label_MHHH_B1)
		self._groupBox_MHHH_OC_CN.Controls.Add(self._label_MHHH_N1)
		self._groupBox_MHHH_OC_CN.Controls.Add(self._label_MHHH_H1)
		self._groupBox_MHHH_OC_CN.Controls.Add(self._label_MHHH_D1)
		self._groupBox_MHHH_OC_CN.Controls.Add(self._txt_MHHH_T1)
		self._groupBox_MHHH_OC_CN.Controls.Add(self._txt_MHHH_N1)
		self._groupBox_MHHH_OC_CN.Location = System.Drawing.Point(3, 3)
		self._groupBox_MHHH_OC_CN.Name = "groupBox_MHHH_OC_CN"
		self._groupBox_MHHH_OC_CN.Size = System.Drawing.Size(370, 266)
		self._groupBox_MHHH_OC_CN.TabIndex = 14
		self._groupBox_MHHH_OC_CN.TabStop = False
		self._groupBox_MHHH_OC_CN.Text = "Thông số hình học ống cống chữ nhật"
		# 
		# groupBox_MHHH_OC_T
		# 
		self._groupBox_MHHH_OC_T.Controls.Add(self._txt_MHHH_S2)
		self._groupBox_MHHH_OC_T.Controls.Add(self._txt_MHHH_R02)
		self._groupBox_MHHH_OC_T.Controls.Add(self._txt_MHHH_R01)
		self._groupBox_MHHH_OC_T.Controls.Add(self._label_MHHH_S2)
		self._groupBox_MHHH_OC_T.Controls.Add(self._label_MHHH_R02)
		self._groupBox_MHHH_OC_T.Controls.Add(self._label_MHHH_R01)
		self._groupBox_MHHH_OC_T.Location = System.Drawing.Point(3, 275)
		self._groupBox_MHHH_OC_T.Name = "groupBox_MHHH_OC_T"
		self._groupBox_MHHH_OC_T.Size = System.Drawing.Size(376, 139)
		self._groupBox_MHHH_OC_T.TabIndex = 15
		self._groupBox_MHHH_OC_T.TabStop = False
		self._groupBox_MHHH_OC_T.Text = "Thông số hình học ống cống tròn"
		# 
		# label_MHHH_R01
		# 
		self._label_MHHH_R01.Location = System.Drawing.Point(14, 20)
		self._label_MHHH_R01.Name = "label_MHHH_R01"
		self._label_MHHH_R01.Size = System.Drawing.Size(186, 23)
		self._label_MHHH_R01.TabIndex = 0
		self._label_MHHH_R01.Text = "Bán kính ngoài ống cống: R01 (m)"
		# 
		# label_MHHH_R02
		# 
		self._label_MHHH_R02.Location = System.Drawing.Point(14, 62)
		self._label_MHHH_R02.Name = "label_MHHH_R02"
		self._label_MHHH_R02.Size = System.Drawing.Size(197, 23)
		self._label_MHHH_R02.TabIndex = 1
		self._label_MHHH_R02.Text = "Bán kính trong của ống cống: R02 (m)"
		# 
		# label_MHHH_S2
		# 
		self._label_MHHH_S2.Location = System.Drawing.Point(14, 103)
		self._label_MHHH_S2.Name = "label_MHHH_S2"
		self._label_MHHH_S2.Size = System.Drawing.Size(216, 23)
		self._label_MHHH_S2.TabIndex = 2
		self._label_MHHH_S2.Text = "Độ sâu ống cống tròn so với nền: S2 (m)"
		# 
		# txt_MHHH_R01
		# 
		self._txt_MHHH_R01.Location = System.Drawing.Point(236, 22)
		self._txt_MHHH_R01.Name = "txt_MHHH_R01"
		self._txt_MHHH_R01.Size = System.Drawing.Size(118, 20)
		self._txt_MHHH_R01.TabIndex = 3
		self._txt_MHHH_R01.Text = "3"
		# 
		# txt_MHHH_R02
		# 
		self._txt_MHHH_R02.Location = System.Drawing.Point(236, 59)
		self._txt_MHHH_R02.Name = "txt_MHHH_R02"
		self._txt_MHHH_R02.Size = System.Drawing.Size(118, 20)
		self._txt_MHHH_R02.TabIndex = 4
		self._txt_MHHH_R02.Text = "2"
		# 
		# txt_MHHH_S2
		# 
		self._txt_MHHH_S2.Location = System.Drawing.Point(236, 100)
		self._txt_MHHH_S2.Name = "txt_MHHH_S2"
		self._txt_MHHH_S2.Size = System.Drawing.Size(118, 20)
		self._txt_MHHH_S2.TabIndex = 5
		self._txt_MHHH_S2.Text = "20"
		# 
		# label_MHHH_R2
		# 
		self._label_MHHH_R2.Location = System.Drawing.Point(6, 187)
		self._label_MHHH_R2.Name = "label_MHHH_R2"
		self._label_MHHH_R2.Size = System.Drawing.Size(226, 23)
		self._label_MHHH_R2.TabIndex = 7
		self._label_MHHH_R2.Text = "Khoảng cách đến ống cống tròn: R2 (m)"
		# 
		# txt_MHHH_R2
		# 
		self._txt_MHHH_R2.Location = System.Drawing.Point(238, 190)
		self._txt_MHHH_R2.Name = "txt_MHHH_R2"
		self._txt_MHHH_R2.Size = System.Drawing.Size(94, 20)
		self._txt_MHHH_R2.TabIndex = 6
		self._txt_MHHH_R2.Text = "15"
		# 
		# label_MHHH_Rt
		# 
		self._label_MHHH_Rt.Location = System.Drawing.Point(7, 225)
		self._label_MHHH_Rt.Name = "label_MHHH_Rt"
		self._label_MHHH_Rt.Size = System.Drawing.Size(152, 23)
		self._label_MHHH_Rt.TabIndex = 8
		self._label_MHHH_Rt.Text = "Bán kính khối nổ: Rt (m)"
		# 
		# txt_MHHH_Rt
		# 
		self._txt_MHHH_Rt.Location = System.Drawing.Point(238, 227)
		self._txt_MHHH_Rt.Name = "txt_MHHH_Rt"
		self._txt_MHHH_Rt.Size = System.Drawing.Size(94, 20)
		self._txt_MHHH_Rt.TabIndex = 9
		self._txt_MHHH_Rt.Text = "1"
		
		#----------------------------- End controls MHHH -------------------------------- #
		
		# txt_VL_NEN_USK_GH
		# 
		self._txt_VL_NEN_USK_GH.Location = System.Drawing.Point(196, 215)
		self._txt_VL_NEN_USK_GH.Name = "txt_VL_NEN_USK_GH"
		self._txt_VL_NEN_USK_GH.Size = System.Drawing.Size(100, 24)
		self._txt_VL_NEN_USK_GH.TabIndex = 11
		# 
		# txt_VL_NEN_USN_GH
		# 
		self._txt_VL_NEN_USN_GH.Location = System.Drawing.Point(196, 256)
		self._txt_VL_NEN_USN_GH.Name = "txt_VL_NEN_USN_GH"
		self._txt_VL_NEN_USN_GH.Size = System.Drawing.Size(100, 24)
		self._txt_VL_NEN_USN_GH.TabIndex = 12
		# 
		# txt_VL_NEN_USK_PH
		# 
		self._txt_VL_NEN_USK_PH.Location = System.Drawing.Point(196, 298)
		self._txt_VL_NEN_USK_PH.Name = "txt_VL_NEN_USK_PH"
		self._txt_VL_NEN_USK_PH.Size = System.Drawing.Size(100, 24)
		self._txt_VL_NEN_USK_PH.TabIndex = 13
		# 
		# label_VL_CT_K
		# 
		self._label_VL_CT_K.Location = System.Drawing.Point(29, 215)
		self._label_VL_CT_K.Name = "label_VL_CT_K"
		self._label_VL_CT_K.Size = System.Drawing.Size(161, 23)
		self._label_VL_CT_K.TabIndex = 14
		self._label_VL_CT_K.Text = "Ứng suất kéo giới hạn"
		# 
		# label_VL_CT_N
		# 
		self._label_VL_CT_N.Location = System.Drawing.Point(29, 254)
		self._label_VL_CT_N.Name = "label_VL_CT_N"
		self._label_VL_CT_N.Size = System.Drawing.Size(161, 23)
		self._label_VL_CT_N.TabIndex = 15
		self._label_VL_CT_N.Text = "Ứng suất nén giới hạn"
		# 
		# label_VL_CT_PH
		# 
		self._label_VL_CT_PH.Location = System.Drawing.Point(29, 298)
		self._label_VL_CT_PH.Name = "label_VL_CT_PH"
		self._label_VL_CT_PH.Size = System.Drawing.Size(161, 23)
		self._label_VL_CT_PH.TabIndex = 16
		self._label_VL_CT_PH.Text = "Ứng suất kéo pha hủy"
		# 
		# label_UNIT_VL_CT_K
		# 
		self._label_UNIT_VL_CT_K.Location = System.Drawing.Point(333, 218)
		self._label_UNIT_VL_CT_K.Name = "label_UNIT_VL_CT_K"
		self._label_UNIT_VL_CT_K.Size = System.Drawing.Size(100, 23)
		self._label_UNIT_VL_CT_K.TabIndex = 17
		self._label_UNIT_VL_CT_K.Text = "MPa"
		# 
		# label_UNIT_VL_CT_N
		# 
		self._label_UNIT_VL_CT_N.Location = System.Drawing.Point(333, 255)
		self._label_UNIT_VL_CT_N.Name = "label_UNIT_VL_CT_N"
		self._label_UNIT_VL_CT_N.Size = System.Drawing.Size(100, 23)
		self._label_UNIT_VL_CT_N.TabIndex = 18
		self._label_UNIT_VL_CT_N.Text = "MPa"
		# 
		# label_UNIT_VL_CT_PH
		# 
		self._label_UNIT_VL_CT_PH.Location = System.Drawing.Point(333, 297)
		self._label_UNIT_VL_CT_PH.Name = "label_UNIT_VL_CT_PH"
		self._label_UNIT_VL_CT_PH.Size = System.Drawing.Size(100, 23)
		self._label_UNIT_VL_CT_PH.TabIndex = 19
		self._label_UNIT_VL_CT_PH.Text = "MPa"
		# 
		# 
		# MainForm
		# 
		self.ClientSize = System.Drawing.Size(989, 471)
		self.Controls.Add(self._tabControl1)
		self.Name = "MainForm"
		self.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
		self.Text = "CHƯƠNG TRÌNH TÍNH TOÁN TỰ ĐỘNG"
		self._tabControl1.ResumeLayout(False)
		self._tabPage1.ResumeLayout(False)
		self._tabPage2.ResumeLayout(False)
		self._pic_MHHH.EndInit()
		self._gb_Action.ResumeLayout(False)
		self._gb_VL_SAN_HO.ResumeLayout(False)
		self._gb_VL_SAN_HO.PerformLayout()
		self._gb_VL_NEN.ResumeLayout(False)
		self._tabControl_MHHH.ResumeLayout(False)
		self._tabPage6.ResumeLayout(False)
		self._tabPage6.PerformLayout()
		self._tabPage7.ResumeLayout(False)
		self._tabPage7.PerformLayout()
		self._tabPage8.ResumeLayout(False)
		self._tabPage8.PerformLayout()
		self._gb_VL_NEN.PerformLayout()
		self.ResumeLayout(False)

	def Btn_Add_VLClick(self, sender, e):
		global choice_Vl
		choice_Vl = self._cbb_TypeMaterial.SelectedIndex
		self.statusActionForEngineerData = "Add"
		self._txt_VL_SAN_HO_NAME.Enabled = True
		self._txt_VL_NEN_NAME.Enabled = True
		if choice_Vl == 0:
			self._gb_VL_NEN.Visible = False
			self._gb_VL_SAN_HO.Visible = True
			self._lb_ListMaterial.Visible = False
			self._txt_VL_SAN_HO_NAME.Text = ""
			self._txt_VL_SAN_HO_NAME.Enabled = True
			self._txt_VL_SAN_HO_E.Enabled = True
			self._txt_VL_SAN_HO_V.Enabled = True
			self._txt_VL_SAN_HO_MD.Enabled = True
			self._txt_VL_SAN_HO_MS.Enabled = True
			self._txt_VL_SAN_HO_TSC.Enabled = True
			self._txt_VL_SAN_HO_TSC_1.Enabled = True
				
		elif choice_Vl == 1:
			self._gb_VL_NEN.Visible = True
			self._gb_VL_SAN_HO.Visible = False
			self._lb_ListMaterial.Visible = False
			self._txt_VL_NEN_NAME.Text = ""
		else:
			MessageBox.Show("Bạn chưa chọn loại vật liệu","Thêm vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Error)
		pass
		
	def Btn_ADD_VL_SANHOClick(self, sender, e):
		choice_Vl = self._cbb_TypeMaterial.SelectedIndex
		checkedItems = self._lb_ListMaterial.CheckedItems
		NameVLValue = ""
		for  item in checkedItems:
			NameVLValue = item.SubItems[1].Text
			break
		tempChoice_VL = self.typeEngineerData[NameVLValue]
		if tempChoice_VL == -1:
			MDValue = self._txt_VL_SAN_HO_MD.Text
			if self.CheckEmptyTextBox(MDValue) or  (not self.CheckNumberTextBox(MDValue)):
				self._txt_VL_SAN_HO_MD.BackColor = Color.Red
				MessageBox.Show("Vật liệu nhập chưa đúng, Bạn phải nhập lại giá trị","Chỉnh sửa vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Error)
				return
			else:
				self._txt_VL_SAN_HO_MD.BackColor = Color.White
				self.EditEngineerData()
				return
		if self.CheckEmptyTextBoxForVL_SANHO():
			MessageBox.Show("Vật liệu nhập chưa đúng, Bạn phải nhập lại giá trị","Thêm vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Error)
		else:
			if self.statusActionForEngineerData == "Add":
				self.AddEngineerData(choice_Vl)
			if self.statusActionForEngineerData == "Edit":
				self.EditEngineerData()
		pass
		
	def Btn_VL_NEN_OKClick(self, sender, e):
		choice_Vl = self._cbb_TypeMaterial.SelectedIndex
		if self.CheckEmptyTextBoxForVL_NEN():
			MessageBox.Show("Vật liệu nhập chưa đúng, Bạn phải nhập lại giá trị","Thêm vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Error)
		else:
			if self.statusActionForEngineerData == "Add":
				self.AddEngineerData(choice_Vl)
			if self.statusActionForEngineerData == "Edit":
				self.EditEngineerData()
		pass	
	def CheckEmptyTextBoxForVL_SANHO(self):
		CheckEmptyVL_SANHO = False
		NameValue = self._txt_VL_SAN_HO_NAME.Text
		EValue = self._txt_VL_SAN_HO_E.Text
		VValue = self._txt_VL_SAN_HO_V.Text
		MDValue = self._txt_VL_SAN_HO_MD.Text
		MSValue = self._txt_VL_SAN_HO_MS.Text
		TSCValue = self._txt_VL_SAN_HO_TSC.Text
		TSCValue_1 = self._txt_VL_SAN_HO_TSC_1.Text
		if self.CheckEmptyTextBox(NameValue):
			CheckEmptyVL_SANHO = True
			self._txt_VL_SAN_HO_NAME.BackColor = Color.Red
		else:
			self._txt_VL_SAN_HO_NAME.BackColor = Color.White
		if self.CheckEmptyTextBox(EValue) or  (not self.CheckNumberTextBox(EValue)):
			CheckEmptyVL_SANHO = True
			self._txt_VL_SAN_HO_E.BackColor = Color.Red
		else:
			self._txt_VL_SAN_HO_E.BackColor = Color.White
		if self.CheckEmptyTextBox(VValue) or  (not self.CheckNumberTextBox(VValue)):
			CheckEmptyVL_SANHO = True
			self._txt_VL_SAN_HO_V.BackColor = Color.Red
		else:
			self._txt_VL_SAN_HO_V.BackColor = Color.White
		if self.CheckEmptyTextBox(MDValue) or  (not self.CheckNumberTextBox(MDValue)):
			CheckEmptyVL_SANHO = True
			self._txt_VL_SAN_HO_MD.BackColor = Color.Red
		else:
			self._txt_VL_SAN_HO_MD.BackColor = Color.White
		if self.CheckEmptyTextBox(MSValue) or  (not self.CheckNumberTextBox(MSValue)):
			CheckEmptyVL_SANHO = True
			self._txt_VL_SAN_HO_MS.BackColor = Color.Red
		else:
			self._txt_VL_SAN_HO_MS.BackColor = Color.White
		if self.CheckEmptyTextBox(TSCValue) or  (not self.CheckNumberTextBox(TSCValue)):
			CheckEmptyVL_SANHO = True
			self._txt_VL_SAN_HO_TSC.BackColor = Color.Red
		else:
			self._txt_VL_SAN_HO_TSC.BackColor = Color.White
		if self.CheckEmptyTextBox(TSCValue_1) or  (not self.CheckNumberTextBox(TSCValue_1)):
			CheckEmptyVL_SANHO = True
			self._txt_VL_SAN_HO_TSC_1.BackColor = Color.Red
		else:
			self._txt_VL_SAN_HO_TSC_1.BackColor = Color.White
		return CheckEmptyVL_SANHO
	
	def CheckEmptyTextBoxForVL_NEN(self):
		CheckEmptyVL_NEN = False
		NameValue = self._txt_VL_NEN_NAME.Text
		EValue = self._txt_VL_NEN_E.Text
		VValue = self._txt_VL_NEN_V.Text
		MDValue = self._txt_VL_NEN_MD.Text
		USK_GH = self._txt_VL_NEN_USK_GH.Text
		USN_GH = self._txt_VL_NEN_USN_GH.Text
		USK_PH = self._txt_VL_NEN_USK_PH.Text
		if self.CheckEmptyTextBox(NameValue):
			CheckEmptyVL_NEN = True
			self._txt_VL_NEN_NAME.BackColor = Color.Red
		else:
			self._txt_VL_NEN_NAME.BackColor = Color.White
		if self.CheckEmptyTextBox(EValue) or  (not self.CheckNumberTextBox(EValue)):
			CheckEmptyVL_NEN = True
			self._txt_VL_NEN_E.BackColor = Color.Red
		else:
			self._txt_VL_NEN_E.BackColor = Color.White
		if self.CheckEmptyTextBox(VValue) or  (not self.CheckNumberTextBox(VValue)):
			CheckEmptyVL_NEN = True
			self._txt_VL_NEN_V.BackColor = Color.Red
		else:
			self._txt_VL_NEN_V.BackColor = Color.White
		if self.CheckEmptyTextBox(MDValue) or  (not self.CheckNumberTextBox(MDValue)):
			CheckEmptyVL_NEN = True
			self._txt_VL_NEN_MD.BackColor = Color.Red
		else:
			self._txt_VL_NEN_MD.BackColor = Color.White
		if self.CheckEmptyTextBox(USK_GH) or  (not self.CheckNumberTextBox(USK_GH)):
			CheckEmptyVL_NEN = True
			self._txt_VL_NEN_USK_GH.BackColor = Color.Red
		else:
			self._txt_VL_NEN_USK_GH.BackColor = Color.White
		if self.CheckEmptyTextBox(USN_GH) or  (not self.CheckNumberTextBox(USN_GH)):
			CheckEmptyVL_NEN = True
			self._txt_VL_NEN_USN_GH.BackColor = Color.Red
		else:
			self._txt_VL_NEN_USN_GH.BackColor = Color.White
		if self.CheckEmptyTextBox(USK_PH) or  (not self.CheckNumberTextBox(USK_PH)):
			CheckEmptyVL_NEN = True
			self._txt_VL_NEN_USK_PH.BackColor = Color.Red
		else:
			self._txt_VL_NEN_USK_PH.BackColor = Color.White
		return CheckEmptyVL_NEN	
		
		
	def CheckEmptyTextBox(self, StringInput):
		checkEmpty = False
		if StringInput == "":
			checkEmpty = True
		return checkEmpty
		
	def CheckNumberTextBox(self, StringInput):
		num_format = re.compile("^[0-9][0-9]*\.?[0-9]*")
		checkNumber = re.match(num_format,StringInput)
		return checkNumber

	
	def AddEngineerData(self, choice_Vl):
		i = self.CheckNamedEngineerData()
		NameData = ""
		YoungValue = ""
		PoissonValue = ""
		KLRValue = ""
		HSMaSatBeTong = ""
		TYSoCan = ""
		TYSoCan_1 = ""
		# Thong so them vao cho vat lieu cong trinh
		USK_GH = ""
		USN_GH = ""
		USK_PH = ""
		if i == 0:
			if choice_Vl == 0:
				NameData = self._txt_VL_SAN_HO_NAME.Text
				YoungValue = self._txt_VL_SAN_HO_E.Text
				PoissonValue = self._txt_VL_SAN_HO_V.Text
				KLRValue = self._txt_VL_SAN_HO_MD.Text
				HSMaSatBeTong = self._txt_VL_SAN_HO_MS.Text
				TYSoCan = self._txt_VL_SAN_HO_TSC.Text
				TYSoCan_1 = self._txt_VL_SAN_HO_TSC_1.Text
				libraryAdd = EngData.OpenLibrary(Name="Explicit Materials",Source="Explicit_Materials.xml")
				explicitMaterials1 = GetDataContainer("Explicit Materials")
				NameData = NameData + ":" +choice_Vl.ToString() + ":" + HSMaSatBeTong
				matl1 = explicitMaterials1.CreateMaterial(Name= NameData)
				matlProp1 = matl1.CreateProperty(Name="Elasticity",Behavior="Isotropic")
				matlProp2 = matl1.CreateProperty(Name="Density")
				matlProp2.SetData(Variables=["Density"],Values=[[KLRValue + "[kg m^-3]"]])
				matlProp1.SetVariableProperty(VariableName="Young's Modulus",Property="Unit",Value="MPa")
				matlProp1.SetData(Variables=["Young's Modulus"],Values=[[YoungValue + "[MPa]"]])
				matlProp1.SetData(Variables=["Poisson's Ratio"],Values=[[PoissonValue]])
				matlProp3 = matl1.CreateProperty(Name="Damping Factor (α)")
				matlProp3.SetData(Variables=["Mass-Matrix Damping Multiplier"],Values=[[TYSoCan]])
				matlProp4 = matl1.CreateProperty(Name="Damping Factor (β)")
				matlProp4.SetData(Variables=["k-Matrix Damping Multiplier"],Values=[[TYSoCan_1]])
			else:
				NameData = self._txt_VL_NEN_NAME.Text
				YoungValue = self._txt_VL_NEN_E.Text
				PoissonValue = self._txt_VL_NEN_V.Text
				KLRValue = self._txt_VL_NEN_MD.Text
				USK_GH = self._txt_VL_NEN_USK_GH.Text
				USN_GH = self._txt_VL_NEN_USN_GH.Text
				USK_PH = self._txt_VL_NEN_USK_PH.Text
				library1 = EngData.OpenLibrary(Name="General Materials",Source="General_Materials.xml")
				systemVLCT = GetSystem(Name="ENGD")
				engineeringDataVLCT = GetDataContainer("General Materials")
				matlVLCT = engineeringDataVLCT.CreateMaterial(Name= NameData)
				matlPropD = matlVLCT.CreateProperty(Name="Density")
				matlPropELAS = matlVLCT.CreateProperty(Name="Elasticity",Behavior="Isotropic")
				matlPropUSK_GH = matlVLCT.CreateProperty(Name="Tensile Yield Strength")
				matlPropUSN_GH = matlVLCT.CreateProperty(Name="Compressive Yield Strength")
				matlPropUSK_PH = matlVLCT.CreateProperty(Name="Tensile Ultimate Strength")
				matlPropD.SetData(Variables=["Density"],Values=[[KLRValue + "[kg m^-3]"]])
				matlPropELAS.SetVariableProperty(VariableName="Young's Modulus",Property="Unit",Value="MPa")
				matlPropELAS.SetData(Variables=["Young's Modulus"],Values=[[YoungValue + "[MPa]"]])
				matlPropELAS.SetData(Variables=["Poisson's Ratio"],Values=[[PoissonValue]])
				matlPropUSK_GH.SetVariableProperty(
					VariableName="Tensile Yield Strength",
					Property="Unit",
					Value="MPa")
				matlPropUSN_GH.SetVariableProperty(
					VariableName="Compressive Yield Strength",
					Property="Unit",
					Value="MPa")
				matlPropUSK_PH.SetVariableProperty(
					VariableName="Tensile Ultimate Strength",
					Property="Unit",
					Value="MPa")
				matlPropUSK_GH.SetData(
					Variables=["Tensile Yield Strength"],
					Values=[[USK_GH + "[MPa]"]])
				matlPropUSN_GH.SetData(
					Variables=["Compressive Yield Strength"],
					Values=[[USN_GH + "[MPa]"]])
				matlPropUSK_PH.SetData(
					Variables=["Tensile Ultimate Strength"],
					Values=[[ USK_PH + "[MPa]"]])
				self.typeEngineerData[NameData] = 1
			# Update lai thu vien cua vat lieu
			libraryAdd = EngData.OpenLibrary(Name="Explicit Materials",Source="Explicit_Materials.xml")
			explicitMaterialsAdd = GetDataContainer("Explicit Materials")
			listMaterialsADD = explicitMaterialsAdd.GetMaterials()
			b = listMaterialsADD.GetEnumerator()
			for ob in b:
				KeyEngineeringData = self.RegularNameOfEngeerData(ob.ToString())
				choiceTypeVL = eval(self.RegularTypeOfEngeerData(ob.ToString()))
				self.listEngineerData[KeyEngineeringData] = ob
				self.typeEngineerData[KeyEngineeringData] = choiceTypeVL
				self.hsMaSatBeTong[KeyEngineeringData] = self.RegularHSMaSatBeTongOfEngeerData(ob.ToString())
			# Load thu vien cua vat lieu cong trinh
			libraryAdd1 = EngData.OpenLibrary(Name="General Materials",Source="General_Materials.xml")
			systemAdd1 = GetSystem(Name="ENGD")
			engineeringDataADD1 = GetDataContainer("General Materials")
			listMaterialsADD1 = engineeringDataADD1.GetMaterials()
			c = listMaterialsADD1.GetEnumerator()
			for ob1 in c:
				KeyEngineeringData = self.RegularNameOfEngeerData(ob1.ToString())
				self.listEngineerData[KeyEngineeringData] = ob1
				
			MessageBox.Show("Bạn thêm vật liệu thành công","Thêm vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Information)
			self.DisplayEngineerData()
		else:
			MessageBox.Show("Tên vật liệu trùng tên, Bạn phải nhập lại tên vật liệu","Thêm vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Error)
	
	
	def Init_EngineerData(self):
		libraryAdd = EngData.OpenLibrary(Name="Explicit Materials",Source="Explicit_Materials.xml")
		explicitMaterials = GetDataContainer("Explicit Materials")
		listMaterialsADD = explicitMaterials.GetMaterials()
		b = listMaterialsADD.GetEnumerator()
		for ob in b:
			KeyEngineeringData = self.RegularNameOfEngeerData(ob.ToString())
			choice_Vl = eval(self.RegularTypeOfEngeerData(ob.ToString()))
			self.listEngineerData[KeyEngineeringData] = ob
			self.typeEngineerData[KeyEngineeringData] = choice_Vl
			self.hsMaSatBeTong[KeyEngineeringData] = self.RegularHSMaSatBeTongOfEngeerData(ob.ToString())
		#---------- Load thu vien cua General engineering data ---------------------------------#
		#libraryAddG = EngData.OpenLibrary(Name="General Materials",Source="General_Materials.xml")
		#systemAddG = GetSystem(Name="ENGD")
		#engineeringDataADDG = systemAddG.GetContainer(ComponentName="Engineering Data")
		#------------------------ Lay du lieu cua vat lieu -------------------------------------#
		#listMaterialsADDG = engineeringDataADDG.GetMaterials()
		#c = listMaterialsADDG.GetEnumerator()
		#for ob1 in c:
		#	matlPropE = ob1.GetProperty(Name="Elasticity")
		#	matlPropE.SetVariableProperty(VariableName="Young's Modulus",Property="Unit",Value="MPa")
		#	matlPropUSK_GH = ob1.GetProperty(Name="Tensile Yield Strength")
		#	matlPropUSK_GH.SetVariableProperty(VariableName="Tensile Yield Strength",Property="Unit",Value="MPa")
		#	matlPropUSN_GH = ob1.GetProperty(Name="Compressive Yield Strength")
		#	matlPropUSN_GH.SetVariableProperty(VariableName="Compressive Yield Strength",Property="Unit",Value="MPa")
		#	matlPropUSK_PH = ob1.GetProperty(Name="Tensile Ultimate Strength")
		#	matlPropUSK_PH.SetVariableProperty(VariableName="Tensile Ultimate Strength",Property="Unit",Value="MPa")
		libraryAddG1 = EngData.OpenLibrary(Name="General Materials",Source="General_Materials.xml")
		systemAddG1 = GetSystem(Name="ENGD")
		engineeringDataADDG1 = GetDataContainer("General Materials")
		#------------------------ Lay du lieu cua vat lieu -------------------------------------#
		listMaterialsADDG1 = engineeringDataADDG1.GetMaterials()
		d = listMaterialsADDG1.GetEnumerator()
		for ob2 in d:
			CheckNameInit = True
			KeyEngineeringData = self.RegularNameOfEngeerData(ob2.ToString())
			for StringNameInit in self.ListInitVLCT:
				if StringNameInit == KeyEngineeringData:
					CheckNameInit = False
					break
			if CheckNameInit:
				self.DeleteForVLNen(KeyEngineeringData)
			else:
				self.listEngineerData[KeyEngineeringData] = ob2
				self.typeEngineerData[KeyEngineeringData] = 1
		self.DisplayEngineerData()
		
	def EditEngineerData(self):
		NameData = ""
		YoungValue = ""
		PoissonValue = ""
		KLRValue = ""
		HSMaSatBeTong = ""
		TYSoCan = ""
		TYSoCan_1 = ""
		choice_Vl = 0
		USK_GH = ""
		USN_GH = ""
		USK_PH = ""
		checkedItems = self._lb_ListMaterial.CheckedItems
		NameVLValue = ""
		for  item in checkedItems:
			NameVLValue = item.SubItems[1].Text
			break
		if self._gb_VL_NEN.Visible == True:
			choice_Vl = 1
		if self._gb_VL_SAN_HO.Visible == True:
			if self.typeEngineerData[NameVLValue] == 0:
				choice_Vl = 0
			if self.typeEngineerData[NameVLValue] == -1:
				choice_Vl = -1
		if choice_Vl == 0:
			NameData = self._txt_VL_SAN_HO_NAME.Text
			YoungValue = self._txt_VL_SAN_HO_E.Text
			PoissonValue = self._txt_VL_SAN_HO_V.Text
			KLRValue = self._txt_VL_SAN_HO_MD.Text
			HSMaSatBeTong = self._txt_VL_SAN_HO_MS.Text
			TYSoCan = self._txt_VL_SAN_HO_TSC.Text
			TYSoCan_1 = self._txt_VL_SAN_HO_TSC_1.Text
			system1 = GetSystem(Name="ENGD")
			libraryAdd = EngData.OpenLibrary(Name="Explicit Materials",Source="Explicit_Materials.xml")
			explicitMaterials1 = GetDataContainer("Explicit Materials")
			tempHSMaSatBeTong = self.hsMaSatBeTong[NameData]
			NameData = NameData + ":" +choice_Vl.ToString() + ":" + tempHSMaSatBeTong
			matl1 = explicitMaterials1.GetMaterial(Name=NameData)
			matlProp1 = matl1.GetProperty(Name="Density")
			matlProp1.SetData(
				Variables=["Density"],
				Values=[[KLRValue + " [kg m^-3]"]])
			matlProp2 = matl1.GetProperty(Name="Elasticity")
			matlProp2.SetData(
				Variables=["Young's Modulus"],
				Values=[[YoungValue + " [MPa]"]])
			matlProp2.SetData(Variables=["Poisson's Ratio"],Values=[[PoissonValue]])
			matlProp3 = matl1.GetProperty(Name="Damping Factor (α)")
			matlProp3.SetData(Variables=["Mass-Matrix Damping Multiplier"],Values=[[TYSoCan]])
			matlProp4 = matl1.GetProperty(Name="Damping Factor (β)")
			matlProp4.SetData(Variables=["k-Matrix Damping Multiplier"],Values=[[TYSoCan_1]])
		if choice_Vl == 1:
			NameData = self._txt_VL_NEN_NAME.Text
			YoungValue = self._txt_VL_NEN_E.Text
			PoissonValue = self._txt_VL_NEN_V.Text
			KLRValue = self._txt_VL_NEN_MD.Text
			USK_GH = self._txt_VL_NEN_USK_GH.Text
			USN_GH = self._txt_VL_NEN_USN_GH.Text
			USK_PH = self._txt_VL_NEN_USK_PH.Text
			systemVLCT = GetSystem(Name="ENGD")
			engineeringDataVLCT = GetDataContainer("General Materials")
			matlVLCT = engineeringDataVLCT.GetMaterial(Name= NameData)
			matlPropD = matlVLCT.GetProperty(Name="Density")
			matlPropELAS = matlVLCT.GetProperty(Name="Elasticity")
			matlPropUSK_GH = matlVLCT.GetProperty(Name="Tensile Yield Strength")
			matlPropUSN_GH = matlVLCT.GetProperty(Name="Compressive Yield Strength")
			matlPropUSK_PH = matlVLCT.GetProperty(Name="Tensile Ultimate Strength")
			matlPropD.SetData(Variables=["Density"],Values=[[KLRValue + "[kg m^-3]"]])
			matlPropELAS.SetVariableProperty(VariableName="Young's Modulus",Property="Unit",Value="MPa")
			matlPropELAS.SetData(Variables=["Young's Modulus"],Values=[[YoungValue + "[MPa]"]])
			matlPropELAS.SetData(Variables=["Poisson's Ratio"],Values=[[PoissonValue]])
			matlPropUSK_GH.SetVariableProperty(
				VariableName="Tensile Yield Strength",
				Property="Unit",
				Value="MPa")
			matlPropUSN_GH.SetVariableProperty(
				VariableName="Compressive Yield Strength",
				Property="Unit",
				Value="MPa")
			matlPropUSK_PH.SetVariableProperty(
				VariableName="Tensile Ultimate Strength",
				Property="Unit",
				Value="MPa")
			matlPropUSK_GH.SetData(
				Variables=["Tensile Yield Strength"],
				Values=[[USK_GH + "[MPa]"]])
			matlPropUSN_GH.SetData(
				Variables=["Compressive Yield Strength"],
				Values=[[USN_GH + "[MPa]"]])
			matlPropUSK_PH.SetData(
				Variables=["Tensile Ultimate Strength"],
				Values=[[ USK_PH + "[MPa]"]])
		# Xet truong hop lay len tu thu vien
		if choice_Vl == -1:
			choice_Vl = -1
			KLRValue = self._txt_VL_SAN_HO_MD.Text
			system1 = GetSystem(Name="ENGD")
			libraryAdd = EngData.OpenLibrary(Name="Explicit Materials",Source="Explicit_Materials.xml")
			explicitMaterials1 = GetDataContainer("Explicit Materials")
			matl1 = explicitMaterials1.GetMaterial(Name=NameVLValue)
			matlProp1 = matl1.GetProperty(Name="Density")
			matlProp1.SetData(Variables=["Density"],Values=[[KLRValue + " [kg m^-3]"]])
		libraryAdd = EngData.OpenLibrary(Name="Explicit Materials",Source="Explicit_Materials.xml")
		explicitMaterialsAdd = GetDataContainer("Explicit Materials")
		listMaterialsADD = explicitMaterialsAdd.GetMaterials()
		b = listMaterialsADD.GetEnumerator()
		for ob in b:
			KeyEngineeringData = self.RegularNameOfEngeerData(ob.ToString())
			choiceTypeVL = eval(self.RegularTypeOfEngeerData(ob.ToString()))
			self.listEngineerData[KeyEngineeringData] = ob
			self.typeEngineerData[KeyEngineeringData] = choiceTypeVL
			self.hsMaSatBeTong[KeyEngineeringData] = self.RegularHSMaSatBeTongOfEngeerData(ob.ToString())
		libraryAddG = EngData.OpenLibrary(Name="General Materials",Source="General_Materials.xml")
		systemAddG = GetSystem(Name="ENGD")
		engineeringDataADDG = GetDataContainer("General Materials")
		listMaterialsADDG = engineeringDataADDG.GetMaterials()
		c = listMaterialsADDG.GetEnumerator()
		for ob1 in c:
			KeyEngineeringData = self.RegularNameOfEngeerData(ob1.ToString())
			self.listEngineerData[KeyEngineeringData] = ob1
			self.typeEngineerData[KeyEngineeringData] = 1	
		MessageBox.Show("Bạn thay đổi vật liệu thành công","Chỉnh sửa vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Information)
		self.DisplayEngineerData()
			
	def Btn_Edit_VLClick(self, sender, e):
		self.statusActionForEngineerData = "Edit"
		NameVLValue = ""
		tempNameVLValue = ""
		choiceTypeVL = 0
		tempHSMaSatBeTong = ""
		tempHSCan = ""
		checkedItems = self._lb_ListMaterial.CheckedItems
		for  item in checkedItems:
			NameVLValue = item.SubItems[1].Text
			break
		if NameVLValue == "":
			MessageBox.Show("Bạn chưa chọn vật liệu thay đổi","Chỉnh sửa vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Error)
			return
		for obj in self.typeEngineerData.Keys:
			if obj == NameVLValue:
				choiceTypeVL = self.typeEngineerData[NameVLValue]
				break
		if choiceTypeVL == 0:
			for ob2 in self.hsMaSatBeTong.Keys:
				if ob2 == NameVLValue:
					tempHSMaSatBeTong = self.hsMaSatBeTong[NameVLValue]
					break
			tempNameVLValue = NameVLValue + ":" + choiceTypeVL.ToString() + ":" + tempHSMaSatBeTong
			self._gb_VL_NEN.Visible = False
			self._gb_VL_SAN_HO.Visible = True
			self._lb_ListMaterial.Visible = False
			ob = self.listEngineerData[NameVLValue]
			proDensity = ob.GetProperty(Name="Density")
			ValueDensity = proDensity.GetData(Variables=["Density"])
			proElasticity = ob.GetProperty(Name="Elasticity")
			ValueYoungModulus = proElasticity.GetData(Variables=["Young's Modulus"])
			ValuePoisson = proElasticity.GetData(Variables=["Poisson's Ratio"])
			proAlpha = ob.GetProperty(Name="Damping Factor (α)")
			ValueAlpha = proAlpha.GetData(Variables=["Mass-Matrix Damping Multiplier"])
			proBeta = ob.GetProperty(Name="Damping Factor (β)")
			ValueBeta = proBeta.GetData(Variables=["k-Matrix Damping Multiplier"])
			self._txt_VL_SAN_HO_NAME.Text = NameVLValue
			self._txt_VL_SAN_HO_NAME.Enabled = False
			self._txt_VL_SAN_HO_E.Enabled = True
			self._txt_VL_SAN_HO_V.Enabled = True
			self._txt_VL_SAN_HO_MD.Enabled = True
			self._txt_VL_SAN_HO_MS.Enabled = True
			self._txt_VL_SAN_HO_TSC.Enabled = True
			self._txt_VL_SAN_HO_TSC_1.Enabled = True
			self._txt_VL_SAN_HO_E.Text = self.CutStringGetNumber(ValueYoungModulus.ToString())
			self._txt_VL_SAN_HO_V.Text = ValuePoisson.ToString()
			self._txt_VL_SAN_HO_MD.Text = self.CutStringGetNumber(ValueDensity.ToString())
			self._txt_VL_SAN_HO_MS.Text = tempHSMaSatBeTong.ToString()
			self._txt_VL_SAN_HO_TSC.Text = ValueAlpha.ToString()
			self._txt_VL_SAN_HO_TSC_1.Text = ValueBeta.ToString()
		if choiceTypeVL == 1:
			self._gb_VL_NEN.Visible = True
			self._gb_VL_SAN_HO.Visible = False
			self._lb_ListMaterial.Visible = False
			ob = self.listEngineerData[NameVLValue]
			proDensity = ob.GetProperty(Name="Density")
			ValueDensity = proDensity.GetData(Variables=["Density"])
			proElasticity = ob.GetProperty(Name="Elasticity")
			ValueYoungModulus = proElasticity.GetData(Variables=["Young's Modulus"])
			ValuePoisson = proElasticity.GetData(Variables=["Poisson's Ratio"])
			proKGH = ob.GetProperty(Name="Tensile Yield Strength")
			ValueKGH = proKGH.GetData(Variables=["Tensile Yield Strength"])
			proNGH = ob.GetProperty(Name="Compressive Yield Strength")
			ValueNGH = proNGH.GetData(Variables=["Compressive Yield Strength"])
			proKPH = ob.GetProperty(Name="Tensile Ultimate Strength")
			ValueKPH = proKPH.GetData(Variables=["Tensile Ultimate Strength"])
			self._txt_VL_NEN_NAME.Text = NameVLValue
			self._txt_VL_NEN_NAME.Enabled = False
			self._txt_VL_NEN_E.Text = self.CutStringGetNumber(ValueYoungModulus.ToString())
			self._txt_VL_NEN_V.Text = ValuePoisson.ToString()
			self._txt_VL_NEN_MD.Text = self.CutStringGetNumber(ValueDensity.ToString())
			self._txt_VL_NEN_USK_GH.Text = self.CutStringGetNumber(ValueKGH.ToString())
			self._txt_VL_NEN_USN_GH.Text = self.CutStringGetNumber(ValueNGH.ToString())
			self._txt_VL_NEN_USK_PH.Text = self.CutStringGetNumber(ValueKPH.ToString())
			self._cbb_TypeMaterial.SelectedIndex = choiceTypeVL
		if choiceTypeVL == -1:
			# Lay cac thuoc tinh cua vat lieu neu thuoc tinh cua vat lieu 
			ob = self.listEngineerData[NameVLValue]
			ListPro = self.GetListMaterialProperties(ob)
			self._gb_VL_NEN.Visible = False
			self._gb_VL_SAN_HO.Visible = True
			self._lb_ListMaterial.Visible = False
			self._txt_VL_SAN_HO_NAME.Enabled = False
			self._txt_VL_SAN_HO_E.Enabled = False
			self._txt_VL_SAN_HO_V.Enabled = False
			self._txt_VL_SAN_HO_MD.Enabled = False
			self._txt_VL_SAN_HO_MS.Enabled = False
			self._txt_VL_SAN_HO_TSC.Enabled = False
			self._txt_VL_SAN_HO_TSC_1.Enabled = False
			ValueDensity = ""
			ValueYoungModulus = ""
			ValuePoisson = ""
			ValueAlpha = ""
			ValueBeta = ""
			for objName in ListPro:
				if objName == "Density":
					proDensity = ob.GetProperty(Name="Density")
					ValueDensity = proDensity.GetData(Variables=["Density"])
					self._txt_VL_SAN_HO_MD.Enabled = True
					break
			for objName in ListPro:
				if objName == "Elasticity":
					proElasticity = ob.GetProperty(Name="Elasticity")
					ValueYoungModulus = proElasticity.GetData(Variables=["Young's Modulus"])
					ValuePoisson = proElasticity.GetData(Variables=["Poisson's Ratio"])
					self._txt_VL_SAN_HO_E.Enabled = True
					self._txt_VL_SAN_HO_V.Enabled = True
					break
			for objName in ListPro:
				if objName == "Damping Factor (α)":
					proAlpha = ob.GetProperty(Name="Damping Factor (α)")
					ValueAlpha = proAlpha.GetData(Variables=["Mass-Matrix Damping Multiplier"])
					self._txt_VL_SAN_HO_TSC.Enabled = True
					break
			for objName in ListPro:
				if objName == "Damping Factor (β)":
					proBeta = ob.GetProperty(Name="Damping Factor (β)")
					ValueBeta = proBeta.GetData(Variables=["-Matrix Damping Multiplier"])
					self._txt_VL_SAN_HO_TSC_1.Enabled = True
					break
			self._txt_VL_SAN_HO_NAME.Text = NameVLValue
			self._txt_VL_SAN_HO_E.Text = self.CutStringGetNumber(ValueYoungModulus.ToString())
			self._txt_VL_SAN_HO_V.Text = ValuePoisson.ToString()
			self._txt_VL_SAN_HO_MD.Text = self.CutStringGetNumber(ValueDensity.ToString())
			self._txt_VL_SAN_HO_TSC.Text = ValueAlpha.ToString()
			self._txt_VL_SAN_HO_TSC_1.Text = ValueBeta.ToString()
		pass
		
	def CutStringGetNumber(self,inputData):
		listOutputData = inputData.Split(" ")
		outputData = listOutputData[0]
		return outputData
		
	def Btn_Delete_VLClick(self, sender, e):
		NameVLValue = ""
		temNameVLValue =""
		choiceType = -1
		HSMaSat = ""
		checkedItems = self._lb_ListMaterial.CheckedItems
		for  item in checkedItems:
			NameVLValue = item.SubItems[1].Text
			break
		if NameVLValue == "":
			MessageBox.Show("Bạn chưa chọn vật liệu để xóa","Xóa vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Error)
			return
		for obj_1 in self.typeEngineerData.Keys:
			if obj_1 == NameVLValue:
				choiceType = self.typeEngineerData[NameVLValue]
				break
		for obj_2 in self.hsMaSatBeTong.Keys:
			if obj_2 == NameVLValue:
				HSMaSat = self.hsMaSatBeTong[NameVLValue]
				break
		if choiceType == -1:
			temNameVLValue = NameVLValue
			self.DeleteForVLSanHo(temNameVLValue)
		elif choiceType == 0:
			temNameVLValue = NameVLValue + ":" + choiceType.ToString() + ":" + HSMaSat
			self.DeleteForVLSanHo(temNameVLValue)
		else:
			temNameVLValue = NameVLValue
			self.DeleteForVLNen(temNameVLValue)
		for obj in self.typeEngineerData.Keys:
			if obj == NameVLValue:
				self.typeEngineerData.Remove(NameVLValue)
				break
		for objTwo in self.listEngineerData.Keys:
			if objTwo == NameVLValue:
				self.listEngineerData.Remove(NameVLValue)
				break
		MessageBox.Show("Bạn đã xóa dữ liệu thành công","Xóa vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Information)
		self.DisplayEngineerData()
		pass
		
	def DeleteForVLSanHo(self, NameVL):
		libraryAdd = EngData.OpenLibrary(Name="Explicit Materials",Source="Explicit_Materials.xml")
		explicitMaterialsENG = GetDataContainer("Explicit Materials")
		matlENG = explicitMaterialsENG.GetMaterial(Name = NameVL)
		matlENG.Delete()
		
	def DeleteForVLNen(self, NameVL):
		libraryAddG1 = EngData.OpenLibrary(Name="General Materials",Source="General_Materials.xml")
		engineeringDataADDG1 = GetDataContainer("General Materials")
		matlENG = engineeringDataADDG1.GetMaterial(Name = NameVL)
		matlENG.Delete()
		
	def Btn_Suppress_VLClick(self, sender, e):
		NameVLValue = ""
		TempNameValue = ""
		choiceType = -1
		HSMaSat = ""
		checkedItems = self._lb_ListMaterial.CheckedItems
		for  item in checkedItems:
			NameVLValue = item.SubItems[1].Text
			break
		if NameVLValue == "":
			MessageBox.Show("Bạn chưa chọn vật liệu để suppress","Suppress vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Error)
			return
		for obj_1 in self.typeEngineerData.Keys:
			if obj_1 == NameVLValue:
				choiceType = self.typeEngineerData[NameVLValue]
				break
		for obj_2 in self.hsMaSatBeTong.Keys:
			if obj_2 == NameVLValue:
				HSMaSat = self.hsMaSatBeTong[NameVLValue]
				break
		if choiceType == -1:
			TempNameValue = NameVLValue
			self.SuppressForVLSanHo(TempNameValue)
			return
		elif choiceType == 0:
			TempNameValue = NameVLValue + ":" + choiceType.ToString() + ":"+ HSMaSat
			self.SuppressForVLSanHo(TempNameValue)
			return
		else:
			TempNameValue = NameVLValue
			self.SuppressForVLNen(TempNameValue)
		MessageBox.Show("Bạn đã suppress dữ liệu thành công trong ANSYS Workbench","Suppress vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Information)
		self.DisplayEngineerData()
		pass
		
	def SuppressForVLSanHo(self, NameVL):
		systemAdd1 = GetSystem(Name="ENGD")
		engineeringDataADD1 = systemAdd1.GetContainer(ComponentName="Engineering Data")
		listMaterialsADD1 = engineeringDataADD1.GetMaterials()
		c = listMaterialsADD1.GetEnumerator()
		CheckUnsuppress = True
		for ob1 in c:
			KeyEngineeringData = self.RegularNameOfEngeerData(ob1.ToString())
			if KeyEngineeringData == NameVL:
				CheckUnsuppress = False
				break
		if CheckUnsuppress:
			MessageBox.Show("Vật liệu thư viện Explicit Materials không thể suppress trong ANSYS Workbench","Suppress vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Error)
		else:
			matlENG = listMaterialsADD1.GetMaterial(Name = NameVL)
			matlENG.SetSuppression(Suppressed=True)
	
	def SuppressForVLNen(self, NameVL):
		libraryAdd1 = EngData.OpenLibrary(Name="General Materials",Source="General_Materials.xml")
		systemAdd1 = GetSystem(Name="ENGD")
		engineeringDataADD1 = systemAdd1.GetContainer(ComponentName="Engineering Data")
		listMaterialsADD1 = engineeringDataADD1.GetMaterials()
		c = listMaterialsADD1.GetEnumerator()
		CheckUnsuppress = True
		for ob1 in c:
			KeyEngineeringData = self.RegularNameOfEngeerData(ob1.ToString())
			if KeyEngineeringData == NameVL:
				CheckUnsuppress = False
				break
		if CheckUnsuppress:
			MessageBox.Show("Vật liệu thư viện General Materials không thể suppress trong ANSYS Workbench","Suppress vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Error)
		else:
			matlENG = listMaterialsADD1.GetMaterial(Name = NameVL)
			matlENG.SetSuppression(Suppressed=True)
	
	def Btn_Unsppress_VLClick(self, sender, e):
		NameVLValue = ""
		choiceType = -1
		HSMaSat = ""
		TySoCan1 = ""
		checkedItems = self._lb_ListMaterial.CheckedItems
		for  item in checkedItems:
			NameVLValue = item.SubItems[1].Text
			break
		if NameVLValue == "":
			MessageBox.Show("Bạn chưa chọn vật liệu để unsuppress","Unsuppress vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Error)
			return
		for obj_1 in self.typeEngineerData.Keys:
			if obj_1 == NameVLValue:
				choiceType = self.typeEngineerData[NameVLValue]
				break
		for obj_2 in self.hsMaSatBeTong.Keys:
			if obj_2 == NameVLValue:
				HSMaSat = self.hsMaSatBeTong[NameVLValue]
				break
		if choiceType == -1:
			TempNameValue = NameVLValue
			self.UnsupressForVLSanHo(TempNameValue)
			return
		elif choiceType == 0:
			TempNameValue = NameVLValue + ":" + choiceType.ToString() + ":"+ HSMaSat
			self.UnsupressForVLSanHo(TempNameValue)
			return
		else:
			TempNameValue = NameVLValue
			self.UnsupressForVLNen(TempNameValue)
		MessageBox.Show("Bạn đã Unsuppress dữ liệu thành công trong ANSYS Workbench","UnSuppress vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Information)
		self.DisplayEngineerData()
		
	def UnsupressForVLSanHo(self, NameVL):
		systemAdd1 = GetSystem(Name="ENGD")
		engineeringDataADD1 = systemAdd1.GetContainer(ComponentName="Engineering Data")
		listMaterialsADD1 = engineeringDataADD1.GetMaterials()
		c = listMaterialsADD1.GetEnumerator()
		CheckUnsuppress = True
		for ob1 in c:
			KeyEngineeringData = self.RegularNameOfEngeerData(ob1.ToString())
			if KeyEngineeringData == NameVL:
				CheckUnsuppress = False
				break
		if CheckUnsuppress:
			MessageBox.Show("Vật liệu thư viện Explicit Materials không thể unsuppress trong ANSYS Workbench","Unsuppress vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Error)
		else:
			matlENG = listMaterialsADD1.GetMaterial(Name = NameVL)
			matlENG.SetSuppression(Suppressed=False)
		
	def UnsupressForVLNen(self, NameVL):
		libraryAdd1 = EngData.OpenLibrary(Name="General Materials",Source="General_Materials.xml")
		systemAdd1 = GetSystem(Name="ENGD")
		engineeringDataADD1 = systemAdd1.GetContainer(ComponentName="Engineering Data")
		listMaterialsADD1 = engineeringDataADD1.GetMaterials()
		c = listMaterialsADD1.GetEnumerator()
		CheckUnsuppress = True
		for ob1 in c:
			KeyEngineeringData = self.RegularNameOfEngeerData(ob1.ToString())
			if KeyEngineeringData == NameVL:
				CheckUnsuppress = False
				break
		if CheckUnsuppress:
			MessageBox.Show("Vật liệu thư viện General Materials không thể unsuppress trong ANSYS Workbench","Unsuppress vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Error)
		else:
			matlENG = listMaterialsADD1.GetMaterial(Name = NameVL)
			matlENG.SetSuppression(Suppressed=False)
		
	def Btn_LIST_VLClick(self, sender, e):
		self._gb_VL_NEN.Visible = False
		self._gb_VL_SAN_HO.Visible = False
		self._lb_ListMaterial.Visible = True
		self.DisplayEngineerData()
		self.CheckNamedEngineerData()
		pass
	
	def CheckNamedEngineerData(self):
		i = 0
		for obj in self.listEngineerData.Keys:
			if self._txt_VL_NEN_NAME.Text == obj or self._txt_VL_SAN_HO_NAME.Text == obj:
				i = 1
				break
		return i
	
	def DisplayEngineerData(self):
		self._lb_ListMaterial.Items.Clear()
		i = 0
		for obj in self.listEngineerData.Values:
			i = i + 1
			j = i
			NameEng = self.RegularNameOfEngeerData(obj.ToString())
			ListPro = self.GetListMaterialProperties(obj)
			ValueDensity = ""
			ValueYoungModulus=""
			ValuePoisson = ""
			for objName in ListPro:
				if objName == "Density":
					proDensity = obj.GetProperty(Name="Density")
					ValueDensity = proDensity.GetData(Variables=["Density"])
					break
			for objName in ListPro:
				if objName == "Elasticity":
					proElasticity = obj.GetProperty(Name="Elasticity")
					ValueYoungModulus = proElasticity.GetData(Variables=["Young's Modulus"])
					ValuePoisson = proElasticity.GetData(Variables=["Poisson's Ratio"])
					break
			Lvi =  ListViewItem()
			Lvi.Text = j.ToString()
			Lvi.SubItems.Add(NameEng)
			Lvi.SubItems.Add(ValueYoungModulus.ToString())
			Lvi.SubItems.Add(ValuePoisson.ToString())
			Lvi.SubItems.Add(ValueDensity.ToString())
			self._lb_ListMaterial.Items.Add(Lvi)
	
	def GetListMaterialProperties(self,mat):
		list = []
		for prop in mat.MaterialProperties:
			list.Add(prop.TypeName)
		return list
	
	def Cbb_TypeMaterialSelectedIndexChanged(self, sender, e):
		choice_Vl = self._cbb_TypeMaterial.SelectedIndex
		if self._lb_ListMaterial.Visible == True:
			self._lb_ListMaterial.Items.Clear()
			i = 0
			t = 0
			for obj in self.listEngineerData.Values:
				NameEng = self.RegularNameOfEngeerData(obj.ToString())
				ListPro = self.GetListMaterialProperties(obj)
				if choice_Vl == 0:
					if self.typeEngineerData[NameEng] == 0 or self.typeEngineerData[NameEng] == -1:
						i = i + 1
						j = i
						ValueDensity = ""
						ValueYoungModulus=""
						ValuePoisson = ""
						for objName in ListPro:
							if objName == "Density":
								proDensity = obj.GetProperty(Name="Density")
								ValueDensity = proDensity.GetData(Variables=["Density"])
								break
						for objName in ListPro:
							if objName == "Elasticity":
								proElasticity = obj.GetProperty(Name="Elasticity")
								ValueYoungModulus = proElasticity.GetData(Variables=["Young's Modulus"])
								ValuePoisson = proElasticity.GetData(Variables=["Poisson's Ratio"])
								break
						Lvi =  ListViewItem()
						Lvi.Text = j.ToString()
						Lvi.SubItems.Add(NameEng)
						Lvi.SubItems.Add(ValueYoungModulus.ToString())
						Lvi.SubItems.Add(ValuePoisson.ToString())
						Lvi.SubItems.Add(ValueDensity.ToString())
						self._lb_ListMaterial.Items.Add(Lvi)
				if choice_Vl == 1:
					if self.typeEngineerData[NameEng] == 1:
						t = t + 1
						k = t
						ValueDensity1 = ""
						ValueYoungModulus1=""
						ValuePoisson1 = ""
						for objName in ListPro:
							if objName == "Density":
								proDensity = obj.GetProperty(Name="Density")
								ValueDensity1 = proDensity.GetData(Variables=["Density"])
								break
						for objName in ListPro:
							if objName == "Elasticity":
								proElasticity = obj.GetProperty(Name="Elasticity")
								ValueYoungModulus1 = proElasticity.GetData(Variables=["Young's Modulus"])
								ValuePoisson1 = proElasticity.GetData(Variables=["Poisson's Ratio"])
								break
						Lvi1 =  ListViewItem()
						Lvi1.Text = k.ToString()
						Lvi1.SubItems.Add(NameEng)
						Lvi1.SubItems.Add(ValueYoungModulus1.ToString())
						Lvi1.SubItems.Add(ValuePoisson1.ToString())
						Lvi1.SubItems.Add(ValueDensity1.ToString())
						self._lb_ListMaterial.Items.Add(Lvi1)
		pass
		
	def AddMaterialForMechanical(self,NameVLValue,MateialType):
		systemModel = GetSystem(Name="SYS")
		componentModel = systemModel.GetComponent(Name="Model")
		componentModel.Refresh()
		modelMHHH = systemModel.GetContainer(ComponentName="Model")
		modelMHHH.Edit(Interactive=False)
		modelMHHH.SendCommand(
			Command = """
				var DS = WB.AppletList.Applet("DSApplet").App;
				var branch = DS.Tree.FirstActiveBranch;
				var geoGroup = DS.Tree.FirstActiveBranch.Model.PrototypeGroup;
				var geom = DS.Tree.FirstActiveBranch.Model.PrototypeGroup.Prototypes;
				for (i=1; i<=geom.Count; i++) {
					if ( i == eval(""" + MateialType.ToString() + """)){
						var proto = geom.Item(i);
						proto.MaterialName = \"""" + NameVLValue +"""\";
					}
				}
			"""
		)
	# Phuong thuc dung de cap nhat vat lieu da duoc set thanh vat lieu favorite	
	def AddMaterialToFavoriteVLNen(self,NameVL):
		systemVLNen = GetSystem(Name="ENGD")
		engineeringDataVLNen = systemVLNen.GetContainer(ComponentName="Engineering Data")
		CheckNameExist = True
		listMaterialsADD = engineeringDataVLNen.GetMaterials()
		b = listMaterialsADD.GetEnumerator()
		for ob in b:
			KeyEngineeringData = self.RegularNameOfEngeerData(ob.ToString())
			if KeyEngineeringData == NameVL:
				CheckNameExist = False
				break
		if CheckNameExist:
			matl = engineeringDataVLNen.ImportMaterial(Name=NameVL,Source="Explicit_Materials.xml")
		else:
			return
		
		
	def AddMaterialToFavoriteVLCT(self,NameVL):
		systemVLNen = GetSystem(Name="ENGD")
		engineeringDataVLCT = systemVLNen.GetContainer(ComponentName="Engineering Data")
		CheckNameExist = True
		listMaterialsADD = engineeringDataVLCT.GetMaterials()
		b = listMaterialsADD.GetEnumerator()
		for ob in b:
			KeyEngineeringData = self.RegularNameOfEngeerData(ob.ToString())
			if KeyEngineeringData == NameVL:
				CheckNameExist = False
				break
		if CheckNameExist:
			matl = engineeringDataVLCT.ImportMaterial(Name=NameVL,Source="General_Materials.xml")
		else:
			return
	def TaskForExitModel(self):
		systemModel = GetSystem(Name="SYS")
		modelMHHH = systemModel.GetContainer(ComponentName="Model")
		modelMHHH.Exit()
	
	def Btn_VL_SELECT_VLClick(self, sender, e):
		if self.ValidateForChoiceVL():
			MessageBox.Show("Bạn chưa chọn vật liệu hoặc loại vật liệu","Lựa chọn vật liệu", MessageBoxButtons.OK, MessageBoxIcon.Error)
			return
		else:
			NameVLValue = ""
			checkedItems = self._lb_ListMaterial.CheckedItems
			for  item in checkedItems:
				NameVLValue = item.SubItems[1].Text
				break
			choiceType_Vl = self._comboBox_VL_Choice_VL.SelectedIndex
			if choiceType_Vl == 0:
				self.VL_Lop_1 = NameVLValue
				self.AddMaterialToFavoriteVLNen(NameVLValue)
				self.AddMaterialForMechanical(NameVLValue,1)
				self.TaskForExitModel()
				self.MessageBoxForInformation("Bạn đã lựa chọn thành công vật liệu san hô - Lớp 1", "Chọn vật liệu")
			if choiceType_Vl == 1:
				self.VL_Lop_2 = NameVLValue
				self.AddMaterialToFavoriteVLNen(NameVLValue)
				self.AddMaterialForMechanical(NameVLValue,5)
				self.TaskForExitModel()
				self.MessageBoxForInformation("Bạn đã lựa chọn thành công vật liệu san hô - Lớp 2", "Chọn vật liệu")
			if choiceType_Vl == 2:
				self.VL_Lop_3 = NameVLValue
				self.AddMaterialToFavoriteVLNen(NameVLValue)
				self.AddMaterialForMechanical(NameVLValue,6)
				self.TaskForExitModel()
				self.MessageBoxForInformation("Bạn đã lựa chọn thành công vật liệu san hô - Lớp 3", "Chọn vật liệu")
			if choiceType_Vl == 3:
				self.VL_Congtrinh = NameVLValue
				self.AddMaterialToFavoriteVLCT(NameVLValue)
				self.AddMaterialForMechanical(NameVLValue,3)
				self.AddMaterialForMechanical(NameVLValue,4)
				self.TaskForExitModel()
				self.MessageBoxForInformation("Bạn đã lựa chọn thành công vật liệu công trình", "Chọn vật liệu")
			if choiceType_Vl == 4:
				self.VL_KhoiNo = NameVLValue
				self.AddMaterialToFavoriteVLNen(NameVLValue)
				self.AddMaterialForMechanical(NameVLValue,2)
				self.TaskForExitModel()
				self.MessageBoxForInformation("Bạn đã lựa chọn thành công vật liệu khối nổ", "Chọn vật liệu")
	def MessageBoxForError(self,MassageContent, MassageTitle):
		MessageBox.Show(MassageContent,MassageTitle, MessageBoxButtons.OK, MessageBoxIcon.Error)
		
	def MessageBoxForInformation(self,MassageContent, MassageTitle):
		MessageBox.Show(MassageContent,MassageTitle, MessageBoxButtons.OK, MessageBoxIcon.Information)
		
	def ValidateForChoiceVL(self):
		FlagForCheck = False
		NameVLValue = ""
		checkedItems = self._lb_ListMaterial.CheckedItems
		for  item in checkedItems:
			NameVLValue = item.SubItems[1].Text
			break
		if NameVLValue == "":
			FlagForCheck = True
			return FlagForCheck
		choiceType_Vl = self._comboBox_VL_Choice_VL.SelectedIndex
		if choiceType_Vl == -1:
			FlagForCheck = True
			return FlagForCheck
		return FlagForCheck
		
		
	def RegularNameOfEngeerData(self,inputData):
		listOutputData = inputData.Split(":")
		outputData = listOutputData[1]
		return outputData
		
	def RegularTypeOfEngeerData(self,inputData):
		listOutputData = inputData.Split(":")
		if len(listOutputData) == 4:
			outputData = listOutputData[2]
		else:
			outputData = "-1"
		return outputData	
		
	def RegularHSMaSatBeTongOfEngeerData(self,inputData):
		listOutputData = inputData.Split(":")
		if len(listOutputData) == 4:
			outputData = listOutputData[3]
		else:
			outputData = ""
		return outputData	
		
	def CheckTypeEngineerData(self):
		return CheckType
		
#----------------------------------- Thao tac voi mo hinh hinh hoc ---------------------------------#
	def InvokeThreadForProcessMHHH(self):
		# ---------------Thong so nen san ho----------------#
		R = self._txt_MHHH_R.Text
		H = self._txt_MHHH_H.Text
		L1 = self._txt_MHHH_L1.Text
		L2 = self._txt_MHHH_L2.Text
		#---------------Thong so cong trinh ----------------#
		H1 = self._txt_MHHH_H1.Text
		B1 = self._txt_MHHH_B1.Text
		D1 = self._txt_MHHH_D1.Text
		N1 = self._txt_MHHH_N1.Text
		T1 = self._txt_MHHH_T1.Text
		T2 = self._txt_MHHH_T2.Text
		S1 = self._txt_MHHH_S1.Text
		R01 = self._txt_MHHH_R01.Text
		R02 = self._txt_MHHH_R02.Text
		S2 = self._txt_MHHH_S2.Text
		#----------------- Thong so tai no -----------------#
		X = self._txt_MHHH_X.Text
		Y = self._txt_MHHH_Y.Text
		R1 = self._txt_MHHH_R1.Text
		R2 = self._txt_MHHH_R2.Text
		Rt = self._txt_MHHH_Rt.Text
		systemSYS = GetSystem(Name="SYS")
		geometry1 = systemSYS.GetContainer(ComponentName="Geometry")
		#geometry1.Edit()
		geometry1.Edit(Interactive=False)
		designPointGeo = Parameters.GetDesignPoint(Name="0")
		#---------------- Cap nhat mo hinh cho vat lieu nen ------------------#
		parameterR = Parameters.GetParameter(Name="P19")
		designPointGeo.SetParameterExpression(
			Parameter=parameterR,
			Expression="%f"%eval(R))
		parameterH = Parameters.GetParameter(Name="P18")
		designPointGeo.SetParameterExpression(
			Parameter=parameterH,
			Expression="%f"%eval(H))
		parameterL1 = Parameters.GetParameter(Name="P20")
		designPointGeo.SetParameterExpression(
			Parameter=parameterL1,
			Expression="%f"%eval(L1))
		parameterL2 = Parameters.GetParameter(Name="P21")
		designPointGeo.SetParameterExpression(
			Parameter=parameterL2,
			Expression="%f"%eval(L2))
		#---------------- Cap nhat mo hinh cho cong trinh ------------------#
		parameterH1 = Parameters.GetParameter(Name="P11")
		designPointGeo.SetParameterExpression(
			Parameter=parameterH1,
			Expression="%f"%eval(H1))
		parameterB1 = Parameters.GetParameter(Name="P10")
		designPointGeo.SetParameterExpression(
			Parameter=parameterB1,
			Expression="%f"%eval(B1))
		parameterD1 = Parameters.GetParameter(Name="P15")
		designPointGeo.SetParameterExpression(
			Parameter=parameterD1,
			Expression="%f"%eval(D1))
		parameterN1 = Parameters.GetParameter(Name="P14")
		designPointGeo.SetParameterExpression(
			Parameter=parameterN1,
			Expression="%f"%eval(N1))
		parameterT1 = Parameters.GetParameter(Name="P12")
		designPointGeo.SetParameterExpression(
			Parameter=parameterT1,
			Expression="%f"%eval(T1))
		parameterT2 = Parameters.GetParameter(Name="P13")
		designPointGeo.SetParameterExpression(
			Parameter=parameterT2,
			Expression="%f"%eval(T2))	
		parameterS1 = Parameters.GetParameter(Name="P23")
		designPointGeo.SetParameterExpression(
			Parameter=parameterS1,
			Expression="%f"%eval(S1))	
		parameterS2 = Parameters.GetParameter(Name="P22")
		designPointGeo.SetParameterExpression(
			Parameter=parameterS2,
			Expression="%f"%eval(S2))
		parameterR01 = Parameters.GetParameter(Name="P16")
		designPointGeo.SetParameterExpression(
			Parameter=parameterR01,
			Expression="%f"%eval(R01))
		parameterR02 = Parameters.GetParameter(Name="P17")
		designPointGeo.SetParameterExpression(
			Parameter=parameterR02,
			Expression="%f"%eval(R02))
		# -------------------------  Cap nhat mo hinh cho khoi no---------------------#
		parameterX = Parameters.GetParameter(Name="P24")
		designPointGeo.SetParameterExpression(
			Parameter=parameterX,
			Expression="%f"%eval(X))
		parameterY = Parameters.GetParameter(Name="P25")
		designPointGeo.SetParameterExpression(
			Parameter=parameterY,
			Expression="%f"%eval(Y))
		parameterR1 = Parameters.GetParameter(Name="P6")
		designPointGeo.SetParameterExpression(
			Parameter=parameterR1,
			Expression="%f"%eval(R1))
		parameterR2 = Parameters.GetParameter(Name="P7")
		designPointGeo.SetParameterExpression(
			Parameter=parameterR2,
			Expression="%f"%eval(R2))
		parameterRt = Parameters.GetParameter(Name="P3")
		designPointGeo.SetParameterExpression(
			Parameter=parameterRt,
			Expression="%f"%eval(Rt))
		Update()
		MessageBox.Show("Mô hình hình học đã được cập nhật","Mô hình hình học", MessageBoxButtons.OK, MessageBoxIcon.Information)
	def Btn_MHHH_OKClick(self, sender, e):
		if self.CheckFormForMHHH():
			self.MassageForErrorInputMHHH()
		else:
			TheadForMHHH = threading.Thread(target=self.InvokeThreadForProcessMHHH())
			TheadForMHHH.daemon = True
			TheadForMHHH.start()
			
	def CheckFormForMHHH(self):
		# ---------------Thong so nen san ho----------------#
		R = self._txt_MHHH_R.Text
		H = self._txt_MHHH_H.Text
		L1 = self._txt_MHHH_L1.Text
		L2 = self._txt_MHHH_L2.Text
		#---------------Thong so cong trinh ----------------#
		H1 = self._txt_MHHH_H1.Text
		B1 = self._txt_MHHH_B1.Text
		D1 = self._txt_MHHH_D1.Text
		N1 = self._txt_MHHH_N1.Text
		T1 = self._txt_MHHH_T1.Text
		T2 = self._txt_MHHH_T2.Text
		S1 = self._txt_MHHH_S1.Text
		R01 = self._txt_MHHH_R01.Text
		R02 = self._txt_MHHH_R02.Text
		S2 = self._txt_MHHH_S2.Text
		#----------------- Thong so tai no -----------------#
		X = self._txt_MHHH_X.Text
		Y = self._txt_MHHH_Y.Text
		R1 = self._txt_MHHH_R1.Text
		R2 = self._txt_MHHH_R2.Text
		Rt = self._txt_MHHH_Rt.Text
		checkFormHHHH = False
		if self.CheckEmptyTextBox(R) or  (not self.CheckNumberTextBox(R)):
			checkFormHHHH = True
			self._txt_MHHH_R.BackColor = Color.Red
		else:
			self._txt_MHHH_R.BackColor = Color.White
		if self.CheckEmptyTextBox(H) or  (not self.CheckNumberTextBox(H)):
			checkFormHHHH = True
			self._txt_MHHH_H.BackColor = Color.Red
		else:
			self._txt_MHHH_H.BackColor = Color.White
		if self.CheckEmptyTextBox(L1) or  (not self.CheckNumberTextBox(L1)):
			checkFormHHHH = True
			self._txt_MHHH_L1.BackColor = Color.Red
		else:
			self._txt_MHHH_L1.BackColor = Color.White
		if self.CheckEmptyTextBox(L2) or  (not self.CheckNumberTextBox(L2)):
			checkFormHHHH = True
			self._txt_MHHH_L2.BackColor = Color.Red
		else:
			self._txt_MHHH_L2.BackColor = Color.White
		
		
		if self.CheckEmptyTextBox(H1) or  (not self.CheckNumberTextBox(H1)):
			checkFormHHHH = True
			self._txt_MHHH_H1.BackColor = Color.Red
		else:
			self._txt_MHHH_H1.BackColor = Color.White
		if self.CheckEmptyTextBox(B1) or  (not self.CheckNumberTextBox(B1)):
			checkFormHHHH = True
			self._txt_MHHH_B1.BackColor = Color.Red
		else:
			self._txt_MHHH_B1.BackColor = Color.White
		if self.CheckEmptyTextBox(D1) or  (not self.CheckNumberTextBox(D1)):
			checkFormHHHH = True
			self._txt_MHHH_D1.BackColor = Color.Red
		else:
			self._txt_MHHH_D1.BackColor = Color.White
		if self.CheckEmptyTextBox(N1) or  (not self.CheckNumberTextBox(N1)):
			checkFormHHHH = True
			self._txt_MHHH_N1.BackColor = Color.Red
		else:
			self._txt_MHHH_N1.BackColor = Color.White
		if self.CheckEmptyTextBox(T1) or  (not self.CheckNumberTextBox(T1)):
			checkFormHHHH = True
			self._txt_MHHH_T1.BackColor = Color.Red
		else:
			self._txt_MHHH_T1.BackColor = Color.White
		if self.CheckEmptyTextBox(T2) or  (not self.CheckNumberTextBox(T2)):
			checkFormHHHH = True
			self._txt_MHHH_T2.BackColor = Color.Red
		else:
			self._txt_MHHH_T2.BackColor = Color.White
		if self.CheckEmptyTextBox(S1) or  (not self.CheckNumberTextBox(S1)):
			checkFormHHHH = True
			self._txt_MHHH_S1.BackColor = Color.Red
		else:
			self._txt_MHHH_S1.BackColor = Color.White
		if self.CheckEmptyTextBox(R01) or  (not self.CheckNumberTextBox(R01)):
			checkFormHHHH = True
			self._txt_MHHH_R01.BackColor = Color.Red
		else:
			self._txt_MHHH_R01.BackColor = Color.White
		if self.CheckEmptyTextBox(R02) or  (not self.CheckNumberTextBox(R02)):
			checkFormHHHH = True
			self._txt_MHHH_R02.BackColor = Color.Red
		else:
			self._txt_MHHH_R02.BackColor = Color.White
		if self.CheckEmptyTextBox(S2) or  (not self.CheckNumberTextBox(S2)):
			checkFormHHHH = True
			self._txt_MHHH_S2.BackColor = Color.Red
		else:
			self._txt_MHHH_S2.BackColor = Color.White
		
		if self.CheckEmptyTextBox(X) or  (not self.CheckNumberTextBox(X)):
			checkFormHHHH = True
			self._txt_MHHH_X.BackColor = Color.Red
		else:
			self._txt_MHHH_X.BackColor = Color.White
		if self.CheckEmptyTextBox(Y) or  (not self.CheckNumberTextBox(Y)):
			checkFormHHHH = True
			self._txt_MHHH_Y.BackColor = Color.Red
		else:
			self._txt_MHHH_Y.BackColor = Color.White
		if self.CheckEmptyTextBox(R1) or  (not self.CheckNumberTextBox(R1)):
			checkFormHHHH = True
			self._txt_MHHH_R1.BackColor = Color.Red
		else:
			self._txt_MHHH_R1.BackColor = Color.White
		if self.CheckEmptyTextBox(R2) or  (not self.CheckNumberTextBox(R2)):
			checkFormHHHH = True
			self._txt_MHHH_R2.BackColor = Color.Red
		else:
			self._txt_MHHH_R2.BackColor = Color.White
		if self.CheckEmptyTextBox(Rt) or  (not self.CheckNumberTextBox(Rt)):
			checkFormHHHH = True
			self._txt_MHHH_Rt.BackColor = Color.Red
		else:
			self._txt_MHHH_Rt.BackColor = Color.White
		return checkFormHHHH
		
		
	def MassageForErrorInputMHHH(self):
		MessageBox.Show("Kích thước mô hình nhập chưa đúng, Bạn phải nhập lại giá trị","Thay đổi mô hình", MessageBoxButtons.OK, MessageBoxIcon.Error)
def startGui():
	global Form1
	Form1 = MainForm()
	Form1.ShowDialog()
try:	
	UIManager.Instance.InvokeOperation("Show GUI", startGui, True)	
except:
	startGui()